MUC/subject: Fix reference to room for save call (self, not room)
authorKim Alvefur <zash@zash.se>
Mon, 18 Apr 2016 17:09:10 +0000 (19:09 +0200)
committerKim Alvefur <zash@zash.se>
Mon, 18 Apr 2016 17:09:10 +0000 (19:09 +0200)
plugins/muc/subject.lib.lua

index 45aa6934ebf4d15b6ea583acedecf65599dbf2d3..832f160b5f2d03d6250d2333558abe318f64111b 100644 (file)
@@ -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