Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 6237:a58685df9d16
plugins/muc: Add room:has_occupant() method
author | daurnimator <quae@daurnimator.com> |
---|---|
date | Tue, 29 Apr 2014 12:54:04 -0400 |
parent | 6236:ee996e679f15 |
child | 6238:b2b523d21891 |
comparison
equal
deleted
inserted
replaced
6236:ee996e679f15 | 6237:a58685df9d16 |
---|---|
134 forget_room(room.jid) | 134 forget_room(room.jid) |
135 end) | 135 end) |
136 | 136 |
137 module:hook("muc-occupant-left",function(event) | 137 module:hook("muc-occupant-left",function(event) |
138 local room = event.room | 138 local room = event.room |
139 if not next(room._occupants) and not persistent.get(room) then -- empty, non-persistent room | 139 if not room:has_occupant() and not persistent.get(room) then -- empty, non-persistent room |
140 module:fire_event("muc-room-destroyed", { room = room }); | 140 module:fire_event("muc-room-destroyed", { room = room }); |
141 end | 141 end |
142 end); | 142 end); |
143 | 143 |
144 -- Watch presence to create rooms | 144 -- Watch presence to create rooms |