aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_presence.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-07-03 11:54:50 +0200
committerKim Alvefur <zash@zash.se>2014-07-03 11:54:50 +0200
commit2233e80e2b9f1a73f6a9e58c9ee19a49f7ae3771 (patch)
tree8243f5f8bd06364be818ec75550a08c612b6ad83 /plugins/mod_presence.lua
parent75c19f9f6c36cb2fb954973f11825513030c6e54 (diff)
downloadprosody-2233e80e2b9f1a73f6a9e58c9ee19a49f7ae3771.tar.gz
prosody-2233e80e2b9f1a73f6a9e58c9ee19a49f7ae3771.zip
mod_presence: Move presence/initial event to correct place so it actually fires
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r--plugins/mod_presence.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 32a25b59..2577573c 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -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