Changeset

7361:3409773ca19a

Merge with Link Mauve
author Kim Alvefur <zash@zash.se>
date Sun, 17 Apr 2016 22:28:48 +0200
parents 7360:7a37fade5380 (diff) 7359:a5a080c12c96 (current diff)
children 7362:032fcb7b80a1
files plugins/muc/mod_muc.lua
diffstat 3 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua	Sat Apr 16 21:08:05 2016 +0100
+++ b/plugins/muc/mod_muc.lua	Sun Apr 17 22:28:48 2016 +0200
@@ -102,11 +102,7 @@
 	local is_persistent = persistent.get(room);
 	persistent_rooms:set(nil, room.jid, is_persistent);
 	if is_persistent then
-		local data = {
-			jid = room.jid;
-			_data = room._data;
-			_affiliations = room._affiliations;
-		};
+		local data = room:freeze();
 		room_configs:set(node, data);
 	elseif forced then
 		room_configs:set(node, nil);
--- a/plugins/muc/muc.lib.lua	Sat Apr 16 21:08:05 2016 +0100
+++ b/plugins/muc/muc.lib.lua	Sun Apr 17 22:28:48 2016 +0200
@@ -1235,6 +1235,14 @@
 	}, room_mt);
 end
 
+function room_mt:freeze()
+	return {
+		jid = self.jid;
+		_data = self._data;
+		_affiliations = self._affiliations;
+	}
+end
+
 _M.room_mt = room_mt;
 
 return _M;
--- a/plugins/muc/subject.lib.lua	Sat Apr 16 21:08:05 2016 +0100
+++ b/plugins/muc/subject.lib.lua	Sun Apr 17 22:28:48 2016 +0200
@@ -82,6 +82,7 @@
 		if role_rank >= valid_roles.moderator or
 			( role_rank >= valid_roles.participant and get_changesubject(event.room) ) then -- and participant
 			set_subject(event.room, occupant.nick, subject:get_text());
+			room:save();
 			return true;
 		else
 			event.origin.send(st.error_reply(stanza, "auth", "forbidden"));