diff 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
line wrap: on
line diff
--- a/mod_carbons/mod_carbons.lua	Sat Feb 22 13:25:01 2014 +0100
+++ b/mod_carbons/mod_carbons.lua	Sat Feb 22 13:26:22 2014 +0100
@@ -62,12 +62,14 @@
 		return -- No use in sending carbons to an offline user
 	end
 
-	if not c2s and stanza:get_child("private", xmlns_carbons) then
-		stanza:maptags(function(tag)
-			if not ( tag.attr.xmlns == xmlns_carbons and tag.name == "private" ) then
-				return tag;
-			end
-		end);
+	if stanza:get_child("private", xmlns_carbons) then
+		if not c2s then
+			stanza:maptags(function(tag)
+				if not ( tag.attr.xmlns == xmlns_carbons and tag.name == "private" ) then
+					return tag;
+				end
+			end);
+		end
 		module:log("debug", "Message tagged private, ignoring");
 		return
 	elseif stanza:get_child("no-copy", "urn:xmpp:hints") then