Diff

plugins/muc/subject.lib.lua @ 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 (2016-04-18)
parent 7357:d69521003e91
child 7401:e16b3fd0bd80
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