Comparison

plugins/muc/mod_muc.lua @ 7372:b2d7e04eb922

MUC: Store rooms on disk on shutdown
author Kim Alvefur <zash@zash.se>
date Mon, 18 Apr 2016 20:32:48 +0200
parent 7371:d5ba0dec0c95
child 7403:d6e6e21057f0
comparison
equal deleted inserted replaced
7371:d5ba0dec0c95 7372:b2d7e04eb922
283 return room[method](room, origin, stanza); 283 return room[method](room, origin, stanza);
284 end, -2) 284 end, -2)
285 end 285 end
286 286
287 function shutdown_component() 287 function shutdown_component()
288 local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"})
289 :tag("status", { code = "332"}):up();
290 for room in each_room(true) do 288 for room in each_room(true) do
291 room:clear(x); 289 room:save(true);
292 end 290 end
293 end 291 end
294 module:hook_global("server-stopping", shutdown_component); 292 module:hook_global("server-stopping", shutdown_component);
295 293
296 do -- Ad-hoc commands 294 do -- Ad-hoc commands