comparison mod_carbons/mod_carbons.lua @ 1324:853a382c9bd6

mod_turncredentials: Advertise the XEP-0215 feature (thanks Gryffus)
author Kim Alvefur <zash@zash.se>
date Fri, 28 Feb 2014 15:36:06 +0100
parents 35c57db6877f
children b21236b6b8d8
comparison
equal deleted inserted replaced
1323:c84ff82658cb 1324:853a382c9bd6
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 stanza:get_child("private", xmlns_carbons) then 65 local private_tag = stanza:child_with_name("private");
66 if private_tag and private.attr.xmlns == xmlns_carbons or private.attr.xmlns == xmlns_carbons_old then
66 if not c2s then 67 if not c2s then
67 stanza:maptags(function(tag) 68 stanza:maptags(function(tag)
68 if not ( tag.attr.xmlns == xmlns_carbons and tag.name == "private" ) then 69 if tag ~= private_tag then
69 return tag; 70 return tag;
70 end 71 end
71 end); 72 end);
72 end 73 end
73 module:log("debug", "Message tagged private, ignoring"); 74 module:log("debug", "Message tagged private, ignoring");