diff options
author | Tobias Markmann <tm@ayena.de> | 2009-03-03 17:48:04 +0100 |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2009-03-03 17:48:04 +0100 |
commit | 7a7a89844a038b071f02fd1af309ba9ebbcda7de (patch) | |
tree | 73946c977be10a965d59de85b3ce6ba3743bc771 /core/presencemanager.lua | |
parent | 3d1e7adbbc0afb8395f02ecd42fe3c38ce6a8d36 (diff) | |
parent | b6b9906c3c653935b55ad79ad4a2c41118f0a0e3 (diff) | |
download | prosody-7a7a89844a038b071f02fd1af309ba9ebbcda7de.tar.gz prosody-7a7a89844a038b071f02fd1af309ba9ebbcda7de.zip |
Merged with main tip.
Diffstat (limited to 'core/presencemanager.lua')
-rw-r--r-- | core/presencemanager.lua | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/core/presencemanager.lua b/core/presencemanager.lua index 8fdf3612..f94ffd55 100644 --- a/core/presencemanager.lua +++ b/core/presencemanager.lua @@ -95,13 +95,16 @@ function handle_normal_presence(origin, stanza, core_route_stanza) 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;
|