MUC: Fix incorrect nesting of status codes when room config changes (fixes #579)
authorMatthew Wild <mwild1@gmail.com>
Wed, 16 Dec 2015 16:41:48 +0000 (16:41 +0000)
committerMatthew Wild <mwild1@gmail.com>
Wed, 16 Dec 2015 16:41:48 +0000 (16:41 +0000)
plugins/muc/muc.lib.lua

index d42fb2eb4345d79a156984afbe9fa803e60ebb6d..5879c256c36f1f04bf9090a037a0e5dbae0205fe 100644 (file)
@@ -736,7 +736,7 @@ function room_mt:process_form(origin, stanza)
 
        if dirty or whois_changed then
                local msg = st.message({type='groupchat', from=self.jid})
-                       :tag('x', {xmlns='http://jabber.org/protocol/muc#user'}):up()
+                       :tag('x', {xmlns='http://jabber.org/protocol/muc#user'});
 
                if dirty then
                        msg.tags[1]:tag('status', {code = '104'}):up();
@@ -745,6 +745,7 @@ function room_mt:process_form(origin, stanza)
                        local code = (whois == 'moderators') and "173" or "172";
                        msg.tags[1]:tag('status', {code = code}):up();
                end
+               msg:up();
 
                self:broadcast_message(msg, false)
        end