diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-07-22 17:08:09 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-07-22 17:08:09 +0100 |
commit | acdcd2b37388a3596c25c2d4c6bc802094a58dec (patch) | |
tree | 2593981ba2580f7c824501dc13223411d34fab49 /plugins/mod_presence.lua | |
parent | 546db4be6d3e112193599d4bb8cc062003d3cd7b (diff) | |
parent | 193ea4ef3030ab24da31f86031f6ea8386331099 (diff) | |
download | prosody-acdcd2b37388a3596c25c2d4c6bc802094a58dec.tar.gz prosody-acdcd2b37388a3596c25c2d4c6bc802094a58dec.zip |
Merge 0.9->trunk
Diffstat (limited to 'plugins/mod_presence.lua')
-rw-r--r-- | plugins/mod_presence.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua index 6d039d83..09a6f9f2 100644 --- a/plugins/mod_presence.lua +++ b/plugins/mod_presence.lua @@ -352,13 +352,15 @@ module:hook("resource-unbind", function(event) -- Send unavailable presence if session.presence 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(); + if err then + pres:tag("status"):text("Disconnected: "..err):up(); + end session:dispatch_stanza(pres); elseif session.directed then local pres = st.presence{ type = "unavailable", from = session.full_jid }; - if not(err) or err == "closed" then err = "connection closed"; end - pres:tag("status"):text("Disconnected: "..err):up(); + if err then + pres:tag("status"):text("Disconnected: "..err):up(); + end for jid in pairs(session.directed) do pres.attr.to = jid; core_post_stanza(session, pres, true); |