# HG changeset patch # User Waqas Hussain # Date 1258908069 -18000 # Node ID f544729f9228ee0b9d330e6f91542aaa052744d8 # Parent 94b7ba39787d041b09947e19cd18f07dcd9f16ea sessionmanager: Added function send_to_interested_resources(). diff -r 94b7ba39787d -r f544729f9228 core/sessionmanager.lua --- 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;