aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-11-22 21:41:09 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-11-22 21:41:09 +0500
commitbb00a63d236fffcfcbea919c12e8585b1c20cadb (patch)
tree0f8e7964eeb3fe49af4b6ff4374a9a5382a4eb50 /core
parent10d98b6eef93eff3a0c5b305aea051017e282785 (diff)
downloadprosody-bb00a63d236fffcfcbea919c12e8585b1c20cadb.tar.gz
prosody-bb00a63d236fffcfcbea919c12e8585b1c20cadb.zip
sessionmanager: Added function send_to_interested_resources().
Diffstat (limited to 'core')
-rw-r--r--core/sessionmanager.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index 8de70e97..5e7fe06d 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -215,4 +215,19 @@ function send_to_available_resources(user, host, stanza)
return count;
end
+function send_to_interested_resources(user, host, stanza)
+ local jid = user.."@"..host;
+ local count = 0;
+ local user = bare_sessions[jid];
+ if user then
+ for k, session in pairs(user.sessions) do
+ if session.interested then
+ session.send(stanza);
+ count = count + 1;
+ end
+ end
+ end
+ return count;
+end
+
return _M;