Software / code / prosody
Comparison
core/sessionmanager.lua @ 6602:61b6a4fc65f1
Merge 0.9->0.10
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 26 Mar 2015 16:48:39 +0000 |
| parent | 6561:bae84401a02c |
| parent | 6599:f93e1b2ec327 |
| child | 6619:78d1706982b2 |
comparison
equal
deleted
inserted
replaced
| 6587:54306208f30b | 6602:61b6a4fc65f1 |
|---|---|
| 112 | 112 |
| 113 -- returns true, nil on success | 113 -- returns true, nil on success |
| 114 -- returns nil, err_type, err, err_message on failure | 114 -- returns nil, err_type, err, err_message on failure |
| 115 function bind_resource(session, resource) | 115 function bind_resource(session, resource) |
| 116 if not session.username then return nil, "auth", "not-authorized", "Cannot bind resource before authentication"; end | 116 if not session.username then return nil, "auth", "not-authorized", "Cannot bind resource before authentication"; end |
| 117 if session.resource then return nil, "cancel", "already-bound", "Cannot bind multiple resources on a single connection"; end | 117 if session.resource then return nil, "cancel", "not-allowed", "Cannot bind multiple resources on a single connection"; end |
| 118 -- We don't support binding multiple resources | 118 -- We don't support binding multiple resources |
| 119 | 119 |
| 120 local event_payload = { session = session, resource = resource }; | 120 local event_payload = { session = session, resource = resource }; |
| 121 if hosts[session.host].events.fire_event("pre-resource-bind", event_payload) == false then | 121 if hosts[session.host].events.fire_event("pre-resource-bind", event_payload) == false then |
| 122 local err = event_payload.error; | 122 local err = event_payload.error; |