# HG changeset patch # User Matthew Wild # Date 1235070018 0 # Node ID 27978a3f2c0c4904545b474f9e06f2f36e6169ad # Parent 6d619c43e61313f46d2b4e0d7edd4bcb1cf3d5de core.presencemanager: Set 'from' attribute on outgoing unavailable directed presences diff -r 6d619c43e613 -r 27978a3f2c0c core/presencemanager.lua --- a/core/presencemanager.lua Thu Feb 19 15:18:44 2009 +0000 +++ b/core/presencemanager.lua Thu Feb 19 19:00:18 2009 +0000 @@ -95,13 +95,16 @@ end origin.priority = 0; if stanza.attr.type == "unavailable" then - origin.presence = nil; - if origin.directed then - for jid in pairs(origin.directed) do - stanza.attr.to = jid; - core_route_stanza(origin, stanza); - end - origin.directed = nil; + origin.presence = nil; + if origin.directed then + local old_from = stanza.attr.from; + stanza.attr.from = origin.full_jid; + for jid in pairs(origin.directed) do + stanza.attr.to = jid; + core_route_stanza(origin, stanza); + end + stanza.attr.from = old_from; + origin.directed = nil; end else origin.presence = stanza;