Comparison

mod_carbons/mod_carbons.lua @ 837:0ef11dee7050

mod_carbons: Fix logic, top resources should only be excluded for incoming messages
author Kim Alvefur <zash@zash.se>
date Sat, 22 Sep 2012 02:06:21 +0200
parent 836:a86131581180
child 850:0900ba54991e
comparison
equal deleted inserted replaced
836:a86131581180 837:0ef11dee7050
80 -- Carbons are sent to resources that have enabled it 80 -- Carbons are sent to resources that have enabled it
81 if session.want_carbons 81 if session.want_carbons
82 -- but not the resource that sent the message, or the one that it's directed to 82 -- but not the resource that sent the message, or the one that it's directed to
83 and session ~= target_session 83 and session ~= target_session
84 -- and isn't among the top resources that would receive the message per standard routing rules 84 -- and isn't among the top resources that would receive the message per standard routing rules
85 and (not c2s or session.priority ~= top_priority) then 85 and (c2s or session.priority ~= top_priority) then
86 carbon.attr.to = session.full_jid; 86 carbon.attr.to = session.full_jid;
87 module:log("debug", "Sending carbon to %s", session.full_jid); 87 module:log("debug", "Sending carbon to %s", session.full_jid);
88 session.send(carbon); 88 session.send(carbon);
89 end 89 end
90 end 90 end