Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
6347:e1a7ccd82fce | 6348:bffc885dc378 |
---|---|
95 track_room(room); | 95 track_room(room); |
96 return room; | 96 return room; |
97 end | 97 end |
98 end | 98 end |
99 | 99 |
100 function forget_room(jid) | 100 function forget_room(room) |
101 rooms[jid] = nil; | 101 local room_jid = room.jid; |
102 local node = jid_split(room.jid); | 102 local node = jid_split(room.jid); |
103 rooms[room_jid] = nil; | |
103 room_configs:set(node, nil); | 104 room_configs:set(node, nil); |
104 if persistent.get(room_jid) then | 105 if persistent.get(room) then |
105 persistent_rooms:set(nil, room_jid, nil); | 106 persistent_rooms:set(nil, room_jid, nil); |
106 end | 107 end |
107 end | 108 end |
108 | 109 |
109 function get_room_from_jid(room_jid) | 110 function get_room_from_jid(room_jid) |
146 module:hook("muc-room-pre-create", function(event) | 147 module:hook("muc-room-pre-create", function(event) |
147 track_room(event.room); | 148 track_room(event.room); |
148 end, -1000); | 149 end, -1000); |
149 | 150 |
150 module:hook("muc-room-destroyed",function(event) | 151 module:hook("muc-room-destroyed",function(event) |
151 local room = event.room | 152 return forget_room(event.room); |
152 forget_room(room.jid) | |
153 end) | 153 end) |
154 | 154 |
155 do | 155 do |
156 local restrict_room_creation = module:get_option("restrict_room_creation"); | 156 local restrict_room_creation = module:get_option("restrict_room_creation"); |
157 if restrict_room_creation == true then | 157 if restrict_room_creation == true then |