# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1450284108 0
# Node ID 2d5751b2f21c4874858b509a6a50cdf02eb89b8e
# Parent  001b3cff4ed86791fbbe6b4d374a8e40fc8605f0
MUC: Fix incorrect nesting of status codes when room config changes (fixes #579)

diff -r 001b3cff4ed8 -r 2d5751b2f21c plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Tue Dec 08 23:20:37 2015 +0100
+++ b/plugins/muc/muc.lib.lua	Wed Dec 16 16:41:48 2015 +0000
@@ -736,7 +736,7 @@
 
 	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 @@
 			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