aboutsummaryrefslogtreecommitdiffstats
path: root/core/sessionmanager.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-10-25 06:49:48 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-10-25 06:49:48 +0500
commit30de4348013dc1f21e916f1b2bb198369ff024bf (patch)
tree06ef10179708274707859145d48450f11d1af96d /core/sessionmanager.lua
parent9bd8c81c916f22ffb11ce4f11f74edc87002fbb2 (diff)
downloadprosody-30de4348013dc1f21e916f1b2bb198369ff024bf.tar.gz
prosody-30de4348013dc1f21e916f1b2bb198369ff024bf.zip
Routing code reorganization
Diffstat (limited to 'core/sessionmanager.lua')
-rw-r--r--core/sessionmanager.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index a7858d9e..db898693 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -115,4 +115,21 @@ function streamopened(session, attr)
session.notopen = nil;
end
+function send_to_available_resources(user, host, stanza)
+ local to = stanza.attr.to;
+ stanza.attr.to = nil;
+ local h = hosts[host];
+ if h and h.type == "local" then
+ local u = h.sessions[user];
+ if u then
+ for k, session in pairs(u.sessions) do
+ if session.presence then
+ session.send(stanza);
+ end
+ end
+ end
+ end
+ stanza.attr.to = to;
+end
+
return _M; \ No newline at end of file