diff plugins/muc/members_only.lib.lua @ 7353:ca31d3271cf8

MUC: Save room to storage once after form processing, not in each individual setter
author Kim Alvefur <zash@zash.se>
date Fri, 15 Apr 2016 11:50:55 +0200
parents 50b24b3476e6
children e16b3fd0bd80
line wrap: on
line diff
--- a/plugins/muc/members_only.lib.lua	Thu Apr 14 21:23:09 2016 +0200
+++ b/plugins/muc/members_only.lib.lua	Fri Apr 15 11:50:55 2016 +0200
@@ -44,7 +44,6 @@
 			module:fire_event("muc-occupant-left", {room = room; nick = occupant.nick; occupant = occupant;});
 		end
 	end
-	room:save(true);
 	return true;
 end
 
@@ -118,6 +117,7 @@
 				from, invitee, room.jid);
 			-- This might fail; ignore for now
 			room:set_affiliation(from, invitee, "member", "Invited by " .. from);
+			room:save();
 		end
 	end
 end);