aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-08-05 17:21:19 +0100
committerMatthew Wild <mwild1@gmail.com>2012-08-05 17:21:19 +0100
commitbcb9e7e055f7bd808e4437571f54ffea9174b101 (patch)
treee484cf5d1806a0a3932418e65e4e4e39a1413e2a
parent18fc86713ef365cb5d699bed2840dc7b8aef6995 (diff)
parent6ae2292381995460166fe1b1f47bdabbad1d04fe (diff)
downloadprosody-bcb9e7e055f7bd808e4437571f54ffea9174b101.tar.gz
prosody-bcb9e7e055f7bd808e4437571f54ffea9174b101.zip
Merge 0.9->trunk (who has been pushing to trunk?)
-rw-r--r--plugins/muc/muc.lib.lua6
-rw-r--r--tools/erlparse.lua8
2 files changed, 12 insertions, 2 deletions
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
diff --git a/tools/erlparse.lua b/tools/erlparse.lua
index dc3a2f94..174585d3 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;
@@ -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;