# HG changeset patch # User Kim Alvefur # Date 1319931693 -7200 # Node ID 7d6a05f94941760a2c929ab3492bad8d2c9fab21 # Parent f28a3f260fc2cabcea3a98472fcbb4290f7ec561 mod_carbons: Fix top_resources loop and correctly stamp sent messages (thanks xnyhps) diff -r f28a3f260fc2 -r 7d6a05f94941 mod_carbons/mod_carbons.lua --- a/mod_carbons/mod_carbons.lua Sat Oct 29 19:59:48 2011 +0200 +++ b/mod_carbons/mod_carbons.lua Sun Oct 30 01:41:33 2011 +0200 @@ -61,7 +61,7 @@ type = orig_type, } :tag("forwarded", { xmlns = xmlns_forward }) - :tag("received", { xmlns = xmlns_carbons }):up() + :tag("sent", { xmlns = xmlns_carbons }):up() :add_child(msg); core_route_stanza(origin, fwd); end @@ -92,8 +92,9 @@ no_carbon_to[resource] = true; else local top_resources = user_sessions.top_resources; - for i=1,top_resources do - no_carbon_to[top_resources[i]] = true; + for i, session in ipairs(top_resources) do + no_carbon_to[session.resource] = true; + module:log("debug", "not going to send to /%s", resource); end end @@ -123,7 +124,7 @@ module:hook("pre-message/bare", c2s_message_handler, 1); module:hook("pre-message/full", c2s_message_handler, 1); -- Stanszas to local clients -module:hook("message/bare", s2c_message_handler, 1); -- this will suck +module:hook("message/bare", s2c_message_handler, 1); module:hook("message/full", s2c_message_handler, 1); module:add_feature(xmlns_carbons);