Sun, 22 Nov 2009 21:41:09 +0500
sessionmanager: Added function send_to_interested_resources().
core/sessionmanager.lua | file | annotate | diff | comparison | revisions |
--- a/core/sessionmanager.lua Sun Nov 22 21:40:01 2009 +0500 +++ b/core/sessionmanager.lua Sun Nov 22 21:41:09 2009 +0500 @@ -215,4 +215,19 @@ 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;