Merge 0.9->trunk
authorWaqas Hussain <waqas20@gmail.com>
Sat, 15 Dec 2012 07:12:32 +0500
changeset 5242 b86172b12912
parent 5239 cf4954f1c35a (current diff)
parent 5241 4516e6bd51b4 (diff)
child 5246 eba55873ef29
Merge 0.9->trunk
--- a/plugins/muc/muc.lib.lua	Tue Dec 11 23:41:02 2012 +0100
+++ b/plugins/muc/muc.lib.lua	Sat Dec 15 07:12:32 2012 +0500
@@ -914,8 +914,8 @@
 		elseif type ~= "error" and type ~= "result" then
 			origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
 		end
-	elseif stanza.name == "message" and not stanza.attr.type and #stanza.tags == 1 and self._jid_nick[stanza.attr.from]
-		and stanza.tags[1].name == "x" and stanza.tags[1].attr.xmlns == "http://jabber.org/protocol/muc#user" then
+	elseif stanza.name == "message" and not(type == "chat" or type == "error" or type == "groupchat" or type == "headline") and #stanza.tags == 1
+		and self._jid_nick[stanza.attr.from] and stanza.tags[1].name == "x" and stanza.tags[1].attr.xmlns == "http://jabber.org/protocol/muc#user" then
 		local x = stanza.tags[1];
 		local payload = (#x.tags == 1 and x.tags[1]);
 		if payload and payload.name == "invite" and payload.attr.to then
--- a/util/sasl/plain.lua	Tue Dec 11 23:41:02 2012 +0100
+++ b/util/sasl/plain.lua	Sat Dec 15 07:12:32 2012 +0500
@@ -66,15 +66,11 @@
 	self.username = authentication
 	if state == false then
 		return "failure", "account-disabled";
-	elseif state == nil then
+	elseif state == nil or not correct then
 		return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent.";
 	end
 
-	if correct then
-		return "success";
-	else
-		return "failure", "not-authorized", "Unable to authorize you with the authentication credentials you've sent.";
-	end
+	return "success";
 end
 
 function init(registerMechanism)