Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 6143:82b3a2155a55
plugins/muc/muc.lib: If decline is to person in room; route to all sessions
| author | daurnimator <quae@daurnimator.com> |
|---|---|
| date | Thu, 27 Mar 2014 19:16:46 -0400 |
| parents | a6e526c00e6e |
| children | cb08bba0443a e488a90195bc |
comparison
equal
deleted
inserted
replaced
| 6142:a6e526c00e6e | 6143:82b3a2155a55 |
|---|---|
| 1135 return true; | 1135 return true; |
| 1136 end | 1136 end |
| 1137 end | 1137 end |
| 1138 | 1138 |
| 1139 module:hook("muc-decline", function(event) | 1139 module:hook("muc-decline", function(event) |
| 1140 event.room:_route_stanza(event.stanza); | 1140 local room, stanza = event.room, event.stanza |
| 1141 local occupant = room:get_occupant_by_real_jid(stanza.attr.to); | |
| 1142 if occupant then | |
| 1143 room:route_to_occupant(occupant, stanza) | |
| 1144 else | |
| 1145 room:route_stanza(stanza); | |
| 1146 end | |
| 1141 return true; | 1147 return true; |
| 1142 end, -1) | 1148 end, -1) |
| 1143 | 1149 |
| 1144 function room_mt:handle_message_to_room(origin, stanza) | 1150 function room_mt:handle_message_to_room(origin, stanza) |
| 1145 local type = stanza.attr.type; | 1151 local type = stanza.attr.type; |
