Diff

plugins/muc/mod_muc.lua @ 6348:bffc885dc378

mod_muc: Fix tracebacks (thanks nick1)
author Kim Alvefur <zash@zash.se>
date Mon, 11 Aug 2014 11:36:30 +0200
parent 6334:ba2555e06c7c
child 6372:305226a9e581
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua	Sun Aug 10 10:31:18 2014 +0200
+++ b/plugins/muc/mod_muc.lua	Mon Aug 11 11:36:30 2014 +0200
@@ -97,11 +97,12 @@
 	end
 end
 
-function forget_room(jid)
-	rooms[jid] = nil;
+function forget_room(room)
+	local room_jid = room.jid;
 	local node = jid_split(room.jid);
+	rooms[room_jid] = nil;
 	room_configs:set(node, nil);
-	if persistent.get(room_jid) then
+	if persistent.get(room) then
 		persistent_rooms:set(nil, room_jid, nil);
 	end
 end
@@ -148,8 +149,7 @@
 end, -1000);
 
 module:hook("muc-room-destroyed",function(event)
-	local room = event.room
-	forget_room(room.jid)
+	return forget_room(event.room);
 end)
 
 do