Software /
code /
prosody
Changeset
2287:efea91c740a2
Merge with tip.
author | Tobias Markmann <tm@ayena.de> |
---|---|
date | Mon, 30 Nov 2009 23:25:10 +0100 |
parents | 2286:e0b2d934f316 (current diff) 2265:7fe644057dc2 (diff) |
children | 2288:3c17fc919f7b |
files | |
diffstat | 2 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/util/sasl/scram.lua Mon Nov 30 23:23:42 2009 +0100 +++ b/util/sasl/scram.lua Mon Nov 30 23:25:10 2009 +0100 @@ -70,8 +70,8 @@ end -- replace =2D with , and =3D with = - username:gsub("=2D", ","); - username:gsub("=3D", "="); + username = username:gsub("=2D", ","); + username = username:gsub("=3D", "="); -- apply SASLprep username = saslprep(username);
--- a/util/stanza.lua Mon Nov 30 23:23:42 2009 +0100 +++ b/util/stanza.lua Mon Nov 30 23:25:10 2009 +0100 @@ -93,6 +93,17 @@ return self; end +function stanza_mt:get_child(name, xmlns) + for _, child in ipairs(self.tags) do + if (not name or child.name == name) + and ((not xmlns and self.attr.xmlns == child.attr.xmlns) + or child.attr.xmlns == xmlns) then + + return child; + end + end +end + function stanza_mt:child_with_name(name) for _, child in ipairs(self.tags) do if child.name == name then return child; end