Changeset

7365:2d502878b784

MUC/subject: Fix reference to room for save call (self, not room)
author Kim Alvefur <zash@zash.se>
date Mon, 18 Apr 2016 19:09:10 +0200
parents 7364:9ea3094b1fca
children 7366:eb3928903009
files plugins/muc/subject.lib.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/subject.lib.lua	Mon Apr 18 19:08:31 2016 +0200
+++ b/plugins/muc/subject.lib.lua	Mon Apr 18 19:09:10 2016 +0200
@@ -76,12 +76,13 @@
 	local stanza = event.stanza;
 	local subject = stanza:get_child("subject");
 	if subject then
+		local room = event.room;
 		local occupant = event.occupant;
 		-- Role check for subject changes
 		local role_rank = valid_roles[occupant and occupant.role or "none"];
 		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());
+			( role_rank >= valid_roles.participant and get_changesubject(room) ) then -- and participant
+			set_subject(room, occupant.nick, subject:get_text());
 			room:save();
 			return true;
 		else