Mercurial > prosody-hg
comparison plugins/mod_presence.lua @ 9788:f47b2ab877d0 0.11
mod_presence: Revert empty 'to' attribute of presence before presence/initial event (fixes #1296)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 17 Jan 2019 01:04:39 +0100 |
| parents | 41c959c5c84b |
| children | 4a419089ad00 |
comparison
equal
deleted
inserted
replaced
| 9777:2e07d2f71599 | 9788:f47b2ab877d0 |
|---|---|
| 61 if item.subscription == "both" or item.subscription == "from" then | 61 if item.subscription == "both" or item.subscription == "from" then |
| 62 stanza.attr.to = jid; | 62 stanza.attr.to = jid; |
| 63 core_post_stanza(origin, stanza, true); | 63 core_post_stanza(origin, stanza, true); |
| 64 end | 64 end |
| 65 end | 65 end |
| 66 stanza.attr.to = nil; | |
| 66 if stanza.attr.type == nil and not origin.presence then -- initial presence | 67 if stanza.attr.type == nil and not origin.presence then -- initial presence |
| 67 module:fire_event("presence/initial", { origin = origin, stanza = stanza } ); | 68 module:fire_event("presence/initial", { origin = origin, stanza = stanza } ); |
| 68 origin.presence = stanza; -- FIXME repeated later | 69 origin.presence = stanza; -- FIXME repeated later |
| 69 local probe = st.presence({from = origin.full_jid, type = "probe"}); | 70 local probe = st.presence({from = origin.full_jid, type = "probe"}); |
| 70 for jid, item in pairs(roster) do -- probe all contacts we are subscribed to | 71 for jid, item in pairs(roster) do -- probe all contacts we are subscribed to |
