Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 6106:4b15cfae2d11
plugins/muc/muc: When there's no history; return an empty iterator
| author | daurnimator <quae@daurnimator.com> |
|---|---|
| date | Tue, 18 Mar 2014 15:42:48 -0400 |
| parents | 68f53b9a186e |
| children | 5491be05b84c |
comparison
equal
deleted
inserted
replaced
| 6105:68f53b9a186e | 6106:4b15cfae2d11 |
|---|---|
| 179 return maxchars, maxstanzas, since | 179 return maxchars, maxstanzas, since |
| 180 end | 180 end |
| 181 -- Get history for 'to' | 181 -- Get history for 'to' |
| 182 function room_mt:get_history(to, maxchars, maxstanzas, since) | 182 function room_mt:get_history(to, maxchars, maxstanzas, since) |
| 183 local history = self._data['history']; -- send discussion history | 183 local history = self._data['history']; -- send discussion history |
| 184 if not history then return end | 184 if not history then return function() end end |
| 185 local history_len = #history | 185 local history_len = #history |
| 186 | 186 |
| 187 maxstanzas = maxstanzas or history_len | 187 maxstanzas = maxstanzas or history_len |
| 188 local n = 0; | 188 local n = 0; |
| 189 local charcount = 0; | 189 local charcount = 0; |
