Software / code / prosody
Comparison
core/sessionmanager.lua @ 1478:da11f2652ae9
sessionmanager: Replace raw session by an event data table for resource bind/unbind events, allowing extra data
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Sun, 05 Jul 2009 16:21:58 +0500 |
| parent | 1471:8b3753b080fc |
| child | 1479:eef17ebe3ca1 |
comparison
equal
deleted
inserted
replaced
| 1477:e0411d6c9bae | 1478:da11f2652ae9 |
|---|---|
| 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); | 69 hosts[session.host].events.fire_event("resource-unbind", {session=session, error=err}); |
| 70 | 70 |
| 71 hosts[session.host].sessions[session.username].sessions[session.resource] = nil; | 71 hosts[session.host].sessions[session.username].sessions[session.resource] = nil; |
| 72 full_sessions[session.full_jid] = nil; | 72 full_sessions[session.full_jid] = nil; |
| 73 | 73 |
| 74 if not next(hosts[session.host].sessions[session.username].sessions) then | 74 if not next(hosts[session.host].sessions[session.username].sessions) then |
| 150 hosts[session.host].sessions[session.username].sessions[resource] = session; | 150 hosts[session.host].sessions[session.username].sessions[resource] = session; |
| 151 full_sessions[session.full_jid] = session; | 151 full_sessions[session.full_jid] = session; |
| 152 | 152 |
| 153 session.roster = rm_load_roster(session.username, session.host); | 153 session.roster = rm_load_roster(session.username, session.host); |
| 154 | 154 |
| 155 hosts[session.host].events.fire_event("resource-bind", session); | 155 hosts[session.host].events.fire_event("resource-bind", {session=session}); |
| 156 | 156 |
| 157 return true; | 157 return true; |
| 158 end | 158 end |
| 159 | 159 |
| 160 function streamopened(session, attr) | 160 function streamopened(session, attr) |