From 4c408e8dfee99aefb7dbaa266ffc9e6036c2a3b5 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 4 Aug 2012 23:22:16 +0500 Subject: MUC: Fix private IQ results and errors for non-vcard queries. --- plugins/muc/muc.lib.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 6d37fbcc..ae6b8e54 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -541,7 +541,11 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc log("debug", "%s sent private stanza to %s (%s)", from, to, o_data.jid); if stanza.name == "iq" then local id = stanza.attr.id; - stanza.attr.from, stanza.attr.to, stanza.attr.id = construct_stanza_id(self, stanza); + if stanza.attr.type == "get" or stanza.attr.type == "set" then + stanza.attr.from, stanza.attr.to, stanza.attr.id = construct_stanza_id(self, stanza); + else + stanza.attr.from, stanza.attr.to, stanza.attr.id = deconstruct_stanza_id(self, stanza); + end if type == 'get' and stanza.tags[1].attr.xmlns == 'vcard-temp' then stanza.attr.to = jid_bare(stanza.attr.to); end -- cgit v1.2.3 From d69fd55cf67321b7d42df1d256c400d900212799 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 4 Aug 2012 23:23:49 +0500 Subject: tools/erlparse: Fix erlang string escape sequences. --- tools/erlparse.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/erlparse.lua b/tools/erlparse.lua index dc3a2f94..287e45ba 100644 --- a/tools/erlparse.lua +++ b/tools/erlparse.lua @@ -51,7 +51,7 @@ local function isSpace(ch) return ch <= _space; end -local escapes = {["\\b"]="\b", ["\\d"]="\d", ["\\e"]="\e", ["\\f"]="\f", ["\\n"]="\n", ["\\r"]="\r", ["\\s"]="\s", ["\\t"]="\t", ["\\v"]="\v", ["\\\""]="\"", ["\\'"]="'", ["\\\\"]="\\"}; +local escapes = {["\\b"]="\b", ["\\d"]="\127", ["\\e"]="\27", ["\\f"]="\f", ["\\n"]="\n", ["\\r"]="\r", ["\\s"]=" ", ["\\t"]="\t", ["\\v"]="\v", ["\\\""]="\"", ["\\'"]="'", ["\\\\"]="\\"}; local function readString() read("\""); -- skip quote local slash = nil; -- cgit v1.2.3 From 6ae2292381995460166fe1b1f47bdabbad1d04fe Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sat, 4 Aug 2012 23:55:52 +0500 Subject: tools/erlparse: Handle decimal point in numbers. --- tools/erlparse.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/erlparse.lua b/tools/erlparse.lua index 287e45ba..174585d3 100644 --- a/tools/erlparse.lua +++ b/tools/erlparse.lua @@ -95,6 +95,12 @@ local function readNumber() while isNumeric(peek()) do num[#num+1] = read(); end + if peek() == "." then + num[#num+1] = read(); + while isNumeric(peek()) do + num[#num+1] = read(); + end + end return tonumber(t_concat(num)); end local readItem = nil; -- cgit v1.2.3