comparison mod_carbons/mod_carbons.lua @ 1317:35c57db6877f

mod_carbons: Ignore messages tagged as private in both directions (thanks hoedlmoser)
author Kim Alvefur <zash@zash.se>
date Sat, 22 Feb 2014 13:26:22 +0100
parents d3e75f6dde9b
children 853a382c9bd6
comparison
equal deleted inserted replaced
1316:d3e75f6dde9b 1317:35c57db6877f
60 if not user_sessions then 60 if not user_sessions then
61 module:log("debug", "Skip carbons for offline user"); 61 module:log("debug", "Skip carbons for offline user");
62 return -- No use in sending carbons to an offline user 62 return -- No use in sending carbons to an offline user
63 end 63 end
64 64
65 if not c2s and stanza:get_child("private", xmlns_carbons) then 65 if stanza:get_child("private", xmlns_carbons) then
66 stanza:maptags(function(tag) 66 if not c2s then
67 if not ( tag.attr.xmlns == xmlns_carbons and tag.name == "private" ) then 67 stanza:maptags(function(tag)
68 return tag; 68 if not ( tag.attr.xmlns == xmlns_carbons and tag.name == "private" ) then
69 end 69 return tag;
70 end); 70 end
71 end);
72 end
71 module:log("debug", "Message tagged private, ignoring"); 73 module:log("debug", "Message tagged private, ignoring");
72 return 74 return
73 elseif stanza:get_child("no-copy", "urn:xmpp:hints") then 75 elseif stanza:get_child("no-copy", "urn:xmpp:hints") then
74 module:log("debug", "Message has no-copy hint, ignoring"); 76 module:log("debug", "Message has no-copy hint, ignoring");
75 return 77 return