Comparison

core/sessionmanager.lua @ 175:5f71d290bb44

Routing code reorganization
author Waqas Hussain <waqas20@gmail.com>
date Sat, 25 Oct 2008 06:49:48 +0500
parent 156:884c43c7028a
child 176:e5cd2a03891d
comparison
equal deleted inserted replaced
174:f9aff1fc7e99 175:5f71d290bb44
113 send("</stream:features>"); 113 send("</stream:features>");
114 log("info", "Stream opened successfully"); 114 log("info", "Stream opened successfully");
115 session.notopen = nil; 115 session.notopen = nil;
116 end 116 end
117 117
118 function send_to_available_resources(user, host, stanza)
119 local to = stanza.attr.to;
120 stanza.attr.to = nil;
121 local h = hosts[host];
122 if h and h.type == "local" then
123 local u = h.sessions[user];
124 if u then
125 for k, session in pairs(u.sessions) do
126 if session.presence then
127 session.send(stanza);
128 end
129 end
130 end
131 end
132 stanza.attr.to = to;
133 end
134
118 return _M; 135 return _M;