Changeset

1748:f4c50c75af6f

MUC: Fixed stanza routing for reloaded rooms.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 07 Sep 2009 20:39:05 +0500
parents 1747:28e5f6b535a8
children 1749:cf2ade983e12
files plugins/muc/mod_muc.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua	Mon Sep 07 20:38:20 2009 +0500
+++ b/plugins/muc/mod_muc.lua	Mon Sep 07 20:39:05 2009 +0500
@@ -89,12 +89,13 @@
 end
 module.restore = function(data)
 	rooms = {};
-	for jid, oldroom in pairs(data.rooms) do
+	for jid, oldroom in pairs(data.rooms or {}) do
 		local room = muc_new_room(jid);
 		room._jid_nick = oldroom._jid_nick;
 		room._occupants = oldroom._occupants;
 		room._data = oldroom._data;
 		room._affiliations = oldroom._affiliations;
+		room.route_stanza = function(room, stanza) core_post_stanza(component, stanza); end;
 		rooms[jid] = room;
 	end
 	prosody.hosts[module:get_host()].muc = { rooms = rooms };