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) |