aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_presence.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-07-04 23:05:27 +0200
committerKim Alvefur <zash@zash.se>2014-07-04 23:05:27 +0200
commit4ee00880c225db985b26614eeb0b3d0d39487c99 (patch)
tree41f4db74c0b05563f71d07478a4d8b3c106359af /plugins/mod_presence.lua
parent6c75e23434fd4ba3eed580582ade3ad8337fd585 (diff)
parent260fc78e4095f1e4ed74d4e76dc1eb23713bacf1 (diff)
downloadprosody-4ee00880c225db985b26614eeb0b3d0d39487c99.tar.gz
prosody-4ee00880c225db985b26614eeb0b3d0d39487c99.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r--plugins/mod_presence.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 32a25b59..9e8f37db 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -55,14 +55,14 @@ local ignore_presence_priority = module:get_option("ignore_presence_priority");
function handle_normal_presence(origin, stanza)
if ignore_presence_priority then
- local priority = stanza:child_with_name("priority");
+ local priority = stanza:get_child("priority");
if priority and priority[1] ~= "0" then
for i=#priority.tags,1,-1 do priority.tags[i] = nil; end
for i=#priority,1,-1 do priority[i] = nil; end
priority[1] = "0";
end
end
- local priority = stanza:child_with_name("priority");
+ local priority = stanza:get_child("priority");
if priority and #priority > 0 then
priority = t_concat(priority);
if s_find(priority, "^[+-]?[0-9]+$") then
@@ -90,6 +90,7 @@ function handle_normal_presence(origin, stanza)
end
end
if stanza.attr.type == nil and not origin.presence then -- initial presence
+ module:fire_event("presence/initial", { origin = origin, stanza = stanza } );
origin.presence = stanza; -- FIXME repeated later
local probe = st.presence({from = origin.full_jid, type = "probe"});
for jid, item in pairs(roster) do -- probe all contacts we are subscribed to
@@ -137,9 +138,6 @@ function handle_normal_presence(origin, stanza)
origin.directed = nil;
end
else
- if not origin.presence then
- module:fire_event("presence/initial", { origin = origin, stanza = stanza } );
- end
origin.presence = stanza;
stanza:tag("delay", { xmlns = "urn:xmpp:delay", from = host, stamp = datetime.datetime() }):up();
if origin.priority ~= priority then