Mercurial > prosody-hg
comparison plugins/muc/mod_muc.lua @ 5997:2d652afa57e4
MUC: Fire muc-room-destroyed event when the last participant leaves a non-persistent room
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 18 Jan 2014 20:14:05 +0100 |
| parents | 355f8b59bf1b |
| children | 0f6399c86c10 bea3862b6bde |
comparison
equal
deleted
inserted
replaced
| 5992:72157e928c23 | 5997:2d652afa57e4 |
|---|---|
| 161 end | 161 end |
| 162 end | 162 end |
| 163 if room then | 163 if room then |
| 164 room:handle_stanza(origin, stanza); | 164 room:handle_stanza(origin, stanza); |
| 165 if not next(room._occupants) and not persistent_rooms[room.jid] then -- empty, non-persistent room | 165 if not next(room._occupants) and not persistent_rooms[room.jid] then -- empty, non-persistent room |
| 166 module:fire_event("muc-room-destroyed", { room = room }); | |
| 166 rooms[bare] = nil; -- discard room | 167 rooms[bare] = nil; -- discard room |
| 167 end | 168 end |
| 168 else | 169 else |
| 169 origin.send(st.error_reply(stanza, "cancel", "not-allowed")); | 170 origin.send(st.error_reply(stanza, "cancel", "not-allowed")); |
| 170 end | 171 end |
