aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2012-12-15 07:12:32 +0500
committerWaqas Hussain <waqas20@gmail.com>2012-12-15 07:12:32 +0500
commit780ab598eafdbc687b3cb12fee8d4ef12eaa105d (patch)
tree6415d15a3d500762074f9a44e55a06d7da8db9be
parent94be66cf24be135f0cae29cf06b1c669bc8fb84f (diff)
parent3ea11533c761072e32111a686910715fbae8d28a (diff)
downloadprosody-780ab598eafdbc687b3cb12fee8d4ef12eaa105d.tar.gz
prosody-780ab598eafdbc687b3cb12fee8d4ef12eaa105d.zip
Merge 0.9->trunk
-rw-r--r--plugins/muc/muc.lib.lua4
-rw-r--r--util/sasl/plain.lua8
2 files changed, 4 insertions, 8 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index c5be3a91..9755ba65 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -914,8 +914,8 @@ function room_mt:handle_to_room(origin, stanza) -- presence changes and groupcha
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
diff --git a/util/sasl/plain.lua b/util/sasl/plain.lua
index ba4645e1..d108a40d 100644
--- a/util/sasl/plain.lua
+++ b/util/sasl/plain.lua
@@ -66,15 +66,11 @@ local function plain(self, message)
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)