plugins/mod_presence.lua

changeset 3109
34280b1544fc
parent 3084
9b17449fb5f4
child 3112
c311fdffccce
equal deleted inserted replaced
3108:df0df92dd58a 3109:34280b1544fc
225 local node, host = jid_split(to_bare); 225 local node, host = jid_split(to_bare);
226 local st_from, st_to = stanza.attr.from, stanza.attr.to; 226 local st_from, st_to = stanza.attr.from, stanza.attr.to;
227 stanza.attr.from, stanza.attr.to = from_bare, to_bare; 227 stanza.attr.from, stanza.attr.to = from_bare, to_bare;
228 log("debug", "inbound presence "..stanza.attr.type.." from "..from_bare.." for "..to_bare); 228 log("debug", "inbound presence "..stanza.attr.type.." from "..from_bare.." for "..to_bare);
229 229
230 if not node then
231 log("debug", "dropping presence sent to host or invalid address '%s'", tostring(to_bare));
232 end
233
234 if stanza.attr.type == "probe" then 230 if stanza.attr.type == "probe" then
235 if rostermanager.is_contact_subscribed(node, host, from_bare) then 231 if rostermanager.is_contact_subscribed(node, host, from_bare) then
236 if 0 == send_presence_of_available_resources(node, host, st_from, origin, core_route_stanza) then 232 if 0 == send_presence_of_available_resources(node, host, st_from, origin, core_route_stanza) then
237 core_route_stanza(hosts[host], st.presence({from=to_bare, to=from_bare, type="unavailable"})); -- TODO send last activity 233 core_route_stanza(hosts[host], st.presence({from=to_bare, to=from_bare, type="unavailable"})); -- TODO send last activity
238 end 234 end

mercurial