Software / code / prosody
Comparison
core/sessionmanager.lua @ 1395:1c547fb4e570
sessionmanager: Fire event on resource unbind
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Tue, 23 Jun 2009 23:54:57 +0500 |
| parent | 1379:03d8a930053f |
| child | 1450:c1c7b27b983b |
comparison
equal
deleted
inserted
replaced
| 1394:2ebed659b958 | 1395:1c547fb4e570 |
|---|---|
| 64 session:dispatch_stanza(pres); | 64 session:dispatch_stanza(pres); |
| 65 end | 65 end |
| 66 | 66 |
| 67 -- Remove session/resource from user's session list | 67 -- Remove session/resource from user's session list |
| 68 if session.full_jid then | 68 if session.full_jid then |
| 69 hosts[session.host].events.fire_event("resource-unbind", session); | |
| 70 | |
| 69 hosts[session.host].sessions[session.username].sessions[session.resource] = nil; | 71 hosts[session.host].sessions[session.username].sessions[session.resource] = nil; |
| 70 full_sessions[session.full_jid] = nil; | 72 full_sessions[session.full_jid] = nil; |
| 71 | 73 |
| 72 if not next(hosts[session.host].sessions[session.username].sessions) then | 74 if not next(hosts[session.host].sessions[session.username].sessions) then |
| 73 log("debug", "All resources of %s are now offline", session.username); | 75 log("debug", "All resources of %s are now offline", session.username); |