Mercurial > prosody-hg
comparison plugins/mod_presence.lua @ 3183:28a5c0bda928
mod_presence: Enable firing of pre-events for probes.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Fri, 04 Jun 2010 18:36:04 +0500 |
| parents | a19dbb6446a0 |
| children | d35b181a895a |
comparison
equal
deleted
inserted
replaced
| 3182:a19dbb6446a0 | 3183:28a5c0bda928 |
|---|---|
| 95 origin.presence = stanza; -- FIXME repeated later | 95 origin.presence = stanza; -- FIXME repeated later |
| 96 local probe = st.presence({from = origin.full_jid, type = "probe"}); | 96 local probe = st.presence({from = origin.full_jid, type = "probe"}); |
| 97 for jid, item in pairs(roster) do -- probe all contacts we are subscribed to | 97 for jid, item in pairs(roster) do -- probe all contacts we are subscribed to |
| 98 if item.subscription == "both" or item.subscription == "to" then | 98 if item.subscription == "both" or item.subscription == "to" then |
| 99 probe.attr.to = jid; | 99 probe.attr.to = jid; |
| 100 core_route_stanza(origin, probe); | 100 core_post_stanza(origin, probe, true); |
| 101 end | 101 end |
| 102 end | 102 end |
| 103 for _, res in pairs(user and user.sessions or NULL) do -- broadcast from all available resources | 103 for _, res in pairs(user and user.sessions or NULL) do -- broadcast from all available resources |
| 104 if res ~= origin and res.presence then | 104 if res ~= origin and res.presence then |
| 105 res.presence.attr.to = origin.full_jid; | 105 res.presence.attr.to = origin.full_jid; |
