Diff

core/sessionmanager.lua @ 176:e5cd2a03891d

Outbound presence subscription
author Waqas Hussain <waqas20@gmail.com>
date Sat, 25 Oct 2008 21:16:08 +0500
parent 175:5f71d290bb44
child 304:7b28fa8bbfe5
line wrap: on
line diff
--- a/core/sessionmanager.lua	Sat Oct 25 06:49:48 2008 +0500
+++ b/core/sessionmanager.lua	Sat Oct 25 21:16:08 2008 +0500
@@ -116,6 +116,7 @@
 end
 
 function send_to_available_resources(user, host, stanza)
+	local count = 0;
 	local to = stanza.attr.to;
 	stanza.attr.to = nil;
 	local h = hosts[host];
@@ -125,11 +126,13 @@
 			for k, session in pairs(u.sessions) do
 				if session.presence then
 					session.send(stanza);
+					count = count + 1;
 				end
 			end
 		end
 	end
 	stanza.attr.to = to;
+	return count;
 end
 
 return _M;
\ No newline at end of file