MUC: Include <status code='100'/> in a message, not in presence. Fixes various issues.

Mon, 19 Apr 2010 18:30:59 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Mon, 19 Apr 2010 18:30:59 +0500
changeset 2978
5760074dc7d4
parent 2977
686f9a5a7f5e
child 2984
3094166cfdd5

MUC: Include <status code='100'/> in a message, not in presence. Fixes various issues.

plugins/muc/muc.lib.lua file | annotate | diff | comparison | revisions
--- a/plugins/muc/muc.lib.lua	Mon Apr 19 18:29:10 2010 +0500
+++ b/plugins/muc/muc.lib.lua	Mon Apr 19 18:30:59 2010 +0500
@@ -319,6 +319,11 @@
 								:tag("item", {affiliation=affiliation or "none", role=role or "none"}):up()
 								:tag("status", {code='110'}));
 						end
+						if self._data.whois == 'anyone' then -- non-anonymous?
+							self:_route_stanza(st.stanza("message", {from=to, to=from, type='groupchat'})
+								:tag("x", {xmlns='http://jabber.org/protocol/muc#user'})
+								:tag("status", {code='100'}));
+						end
 						self:send_history(from);
 					else -- banned
 						local reply = st.error_reply(stanza, "auth", "forbidden"):up();
@@ -799,9 +804,6 @@
 				end
 			end
 		end
-		if self._data.whois == 'anyone' then
-		    muc_child:tag('status', { code = '100' });
-		end
 	end
 	self:route_stanza(stanza);
 	if muc_child then

mercurial