# HG changeset patch # User Kim Alvefur # Date 1404381290 -7200 # Node ID 7a604381d6fc78c07c5a66b62dae9b718ad70122 # Parent a29cc79295e66ab3036020b238b484e3c1887cae mod_presence: Move presence/initial event to correct place so it actually fires diff -r a29cc79295e6 -r 7a604381d6fc plugins/mod_presence.lua --- a/plugins/mod_presence.lua Mon Jun 30 13:11:01 2014 +0200 +++ b/plugins/mod_presence.lua Thu Jul 03 11:54:50 2014 +0200 @@ -90,6 +90,7 @@ 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 @@ 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