Software / code / prosody
Comparison
plugins/muc/muc.lib.lua @ 6178:e12b13a46878
mod_muc/muc.lib: Fix parameters to send_history() (thanks Peter Villeneuve)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sat, 10 May 2014 21:30:00 +0100 |
| parent | 6144:cb08bba0443a |
| child | 6233:f400a4cdf352 |
comparison
equal
deleted
inserted
replaced
| 6177:b8a1143c8851 | 6178:e12b13a46878 |
|---|---|
| 236 return msg | 236 return msg |
| 237 end | 237 end |
| 238 return true; | 238 return true; |
| 239 end) | 239 end) |
| 240 | 240 |
| 241 function room_mt:send_history(stanza) | 241 function room_mt:send_history(to, stanza) |
| 242 local maxchars, maxstanzas, since = parse_history(stanza) | 242 local maxchars, maxstanzas, since = parse_history(stanza) |
| 243 local event = { | 243 local event = { |
| 244 room = self; | 244 room = self; |
| 245 to = stanza.attr.from; -- `to` is required to calculate the character count for `maxchars` | 245 to = to; -- `to` is required to calculate the character count for `maxchars` |
| 246 maxchars = maxchars, maxstanzas = maxstanzas, since = since; | 246 maxchars = maxchars, maxstanzas = maxstanzas, since = since; |
| 247 next_stanza = function() end; -- events should define this iterator | 247 next_stanza = function() end; -- events should define this iterator |
| 248 } | 248 } |
| 249 module:fire_event("muc-get-history", event) | 249 module:fire_event("muc-get-history", event) |
| 250 for msg in event.next_stanza , event do | 250 for msg in event.next_stanza , event do |