From bb00a63d236fffcfcbea919c12e8585b1c20cadb Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 22 Nov 2009 21:41:09 +0500 Subject: sessionmanager: Added function send_to_interested_resources(). --- core/sessionmanager.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/sessionmanager.lua') 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; -- cgit v1.2.3