aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_presence.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-05-23 23:05:01 +0100
committerMatthew Wild <mwild1@gmail.com>2010-05-23 23:05:01 +0100
commit84b7c3f97831c15d262663f6bc58b552adb11398 (patch)
tree67f0b2680ad137ebd5cd25ae840d910088fc35e4 /plugins/mod_presence.lua
parent4b31a9798fee915ced267f8196af658d74075652 (diff)
parentc918263d056fa6c099bbc704d8e0a17b24d546d7 (diff)
downloadprosody-84b7c3f97831c15d262663f6bc58b552adb11398.tar.gz
prosody-84b7c3f97831c15d262663f6bc58b552adb11398.zip
Merge 0.7/waqas->0.7/MattJ
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r--plugins/mod_presence.lua9
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 535e65d7..9071ae4c 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -227,16 +227,13 @@ function handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_b
stanza.attr.from, stanza.attr.to = from_bare, to_bare;
log("debug", "inbound presence "..stanza.attr.type.." from "..from_bare.." for "..to_bare);
- if not node then
- log("debug", "dropping presence sent to host or invalid address '%s'", tostring(to_bare));
- end
-
if stanza.attr.type == "probe" then
- if rostermanager.is_contact_subscribed(node, host, from_bare) then
+ local result, err = rostermanager.is_contact_subscribed(node, host, from_bare);
+ if result then
if 0 == send_presence_of_available_resources(node, host, st_from, origin, core_route_stanza) then
core_route_stanza(hosts[host], st.presence({from=to_bare, to=from_bare, type="unavailable"})); -- TODO send last activity
end
- else
+ elseif not err then
core_route_stanza(hosts[host], st.presence({from=to_bare, to=from_bare, type="unsubscribed"}));
end
elseif stanza.attr.type == "subscribe" then