Software /
code /
prosody
Comparison
plugins/mod_presence.lua @ 1606:bbadcaab0036
mod_presence: Tag outgoing unavailables generated by a disconnect with a from attribute
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 27 Jul 2009 01:27:51 +0100 |
parent | 1568:b11bac42d56f |
child | 1626:7f17d0d00fbb |
comparison
equal
deleted
inserted
replaced
1581:4cdf9cefa0bc | 1606:bbadcaab0036 |
---|---|
328 local pres = st.presence{ type = "unavailable" }; | 328 local pres = st.presence{ type = "unavailable" }; |
329 if not(err) or err == "closed" then err = "connection closed"; end | 329 if not(err) or err == "closed" then err = "connection closed"; end |
330 pres:tag("status"):text("Disconnected: "..err):up(); | 330 pres:tag("status"):text("Disconnected: "..err):up(); |
331 session:dispatch_stanza(pres); | 331 session:dispatch_stanza(pres); |
332 elseif session.directed then | 332 elseif session.directed then |
333 local pres = st.presence{ type = "unavailable" }; | 333 local pres = st.presence{ type = "unavailable", from = session.full_jid }; |
334 if not(err) or err == "closed" then err = "connection closed"; end | 334 if not(err) or err == "closed" then err = "connection closed"; end |
335 pres:tag("status"):text("Disconnected: "..err):up(); | 335 pres:tag("status"):text("Disconnected: "..err):up(); |
336 for jid in pairs(session.directed) do | 336 for jid in pairs(session.directed) do |
337 pres.attr.to = jid; | 337 pres.attr.to = jid; |
338 core_route_stanza(session, pres); | 338 core_route_stanza(session, pres); |