plugins/mod_presence.lua
changeset 3183 28a5c0bda928
parent 3182 a19dbb6446a0
child 3196 d35b181a895a
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;