Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 6237:a58685df9d16
plugins/muc: Add room:has_occupant() method
| author | daurnimator <quae@daurnimator.com> |
|---|---|
| date | Tue, 29 Apr 2014 12:54:04 -0400 |
| parents | bc12a8253f94 |
| children | 641756a6a5f7 |
comparison
equal
deleted
inserted
replaced
| 6236:ee996e679f15 | 6237:a58685df9d16 |
|---|---|
| 75 return next_occupant_jid, occupant_lib.copy(raw_occupant); | 75 return next_occupant_jid, occupant_lib.copy(raw_occupant); |
| 76 end | 76 end |
| 77 function room_mt:each_occupant(read_only) | 77 function room_mt:each_occupant(read_only) |
| 78 return next_copied_occupant, self._occupants, nil; | 78 return next_copied_occupant, self._occupants, nil; |
| 79 end | 79 end |
| 80 end | |
| 81 | |
| 82 function room_mt:has_occupant() | |
| 83 return next(self._occupants, nil) ~= nil | |
| 80 end | 84 end |
| 81 | 85 |
| 82 function room_mt:get_occupant_by_real_jid(real_jid) | 86 function room_mt:get_occupant_by_real_jid(real_jid) |
| 83 local occupant_jid = self:get_occupant_jid(real_jid); | 87 local occupant_jid = self:get_occupant_jid(real_jid); |
| 84 if occupant_jid == nil then return nil end | 88 if occupant_jid == nil then return nil end |
