diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-07-05 20:40:31 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-07-05 20:40:31 +0500 |
commit | d1ee8e0f537fdc3c5b31557a021a9601544d9cd4 (patch) | |
tree | b19576c03fcd22aeeeedce9f6f864f62399bcae1 /plugins/mod_presence.lua | |
parent | 44ba02eef0075861e2398dfb5959288c9330f781 (diff) | |
download | prosody-d1ee8e0f537fdc3c5b31557a021a9601544d9cd4.tar.gz prosody-d1ee8e0f537fdc3c5b31557a021a9601544d9cd4.zip |
mod_presence: Send unavailable presence to resources from non-available resources on disconnect
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r-- | plugins/mod_presence.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua index 4fa9f431..89136e3d 100644 --- a/plugins/mod_presence.lua +++ b/plugins/mod_presence.lua @@ -324,5 +324,14 @@ module:hook("resource-unbind", function(event) if not(err) or err == "closed" then err = "connection closed"; end
pres:tag("status"):text("Disconnected: "..err):up();
session:dispatch_stanza(pres);
+ elseif session.directed then
+ local pres = st.presence{ type = "unavailable" };
+ if not(err) or err == "closed" then err = "connection closed"; end
+ pres:tag("status"):text("Disconnected: "..err):up();
+ for jid in pairs(session.directed) do
+ pres.attr.to = jid;
+ core_route_stanza(session, pres);
+ end
+ session.directed = nil;
end
end);
|