aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/subject.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-04-18 19:09:10 +0200
committerKim Alvefur <zash@zash.se>2016-04-18 19:09:10 +0200
commit17eceebb5811918b8d50a22bd92c8cff920e2d7f (patch)
treefae8c40922081384d992728eac6bfe70bc7488f5 /plugins/muc/subject.lib.lua
parentb3640131f9f16fd273b8f78654472f5d0b79e531 (diff)
downloadprosody-17eceebb5811918b8d50a22bd92c8cff920e2d7f.tar.gz
prosody-17eceebb5811918b8d50a22bd92c8cff920e2d7f.zip
MUC/subject: Fix reference to room for save call (self, not room)
Diffstat (limited to 'plugins/muc/subject.lib.lua')
-rw-r--r--plugins/muc/subject.lib.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/muc/subject.lib.lua b/plugins/muc/subject.lib.lua
index 45aa6934..832f160b 100644
--- a/plugins/muc/subject.lib.lua
+++ b/plugins/muc/subject.lib.lua
@@ -76,12 +76,13 @@ module:hook("muc-occupant-groupchat", function(event)
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