Mercurial > prosody-hg
comparison core/sessionmanager.lua @ 6679:96e034508978
Merge 0.10->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 13 May 2015 17:00:27 +0100 |
| parents | 1089f45c5e67 |
| children | 6236668da30a |
comparison
equal
deleted
inserted
replaced
| 6666:42fdc8dddf04 | 6679:96e034508978 |
|---|---|
| 196 function send_to_available_resources(username, host, stanza) | 196 function send_to_available_resources(username, host, stanza) |
| 197 local jid = username.."@"..host; | 197 local jid = username.."@"..host; |
| 198 local count = 0; | 198 local count = 0; |
| 199 local user = bare_sessions[jid]; | 199 local user = bare_sessions[jid]; |
| 200 if user then | 200 if user then |
| 201 for k, session in pairs(user.sessions) do | 201 for _, session in pairs(user.sessions) do |
| 202 if session.presence then | 202 if session.presence then |
| 203 session.send(stanza); | 203 session.send(stanza); |
| 204 count = count + 1; | 204 count = count + 1; |
| 205 end | 205 end |
| 206 end | 206 end |
| 207 end | 207 end |
| 208 return count; | 208 return count; |
| 209 end | 209 end |
| 210 | 210 |
| 211 function send_to_interested_resources(user, host, stanza) | 211 function send_to_interested_resources(username, host, stanza) |
| 212 local jid = user.."@"..host; | 212 local jid = username.."@"..host; |
| 213 local count = 0; | 213 local count = 0; |
| 214 local user = bare_sessions[jid]; | 214 local user = bare_sessions[jid]; |
| 215 if user then | 215 if user then |
| 216 for k, session in pairs(user.sessions) do | 216 for _, session in pairs(user.sessions) do |
| 217 if session.interested then | 217 if session.interested then |
| 218 session.send(stanza); | 218 session.send(stanza); |
| 219 count = count + 1; | 219 count = count + 1; |
| 220 end | 220 end |
| 221 end | 221 end |
