Diff

plugins/mod_privacy.lua @ 2516:68a889016a46

mod_privacy: Trailing whitespace (I can't sleep)
author Matthew Wild <mwild1@gmail.com>
date Fri, 29 Jan 2010 02:16:43 +0000
parent 2502:ec3eaf54bbd4
child 2517:d0c43c4dcb3f
line wrap: on
line diff
--- a/plugins/mod_privacy.lua	Thu Jan 28 18:11:24 2010 +0000
+++ b/plugins/mod_privacy.lua	Fri Jan 29 02:16:43 2010 +0000
@@ -102,7 +102,7 @@
 			elseif item.type == "group" then
 			elseif item.type == "subscription" then
 			elseif item.type == nil then
-			end		
+			end
 		end
 	else
 		module:log("debug", "got unknown type: %s", type(listnameOrItem));
@@ -200,7 +200,7 @@
 		
 		if item.attr.type ~= nil and item.attr.type ~= "jid" and item.attr.type ~= "subscription" and item.attr.type ~= "group" then
 			return {"modify", "bad-request", "Type attribute not valid."};
-		end 
+		end
 		
 		local tmp = {};
 		orderCheck[item.attr.order] = true;
@@ -252,7 +252,7 @@
 			return {"cancel", "bad-request", "Action must be either deny or allow."};
 		end
 		
---[[		
+--[[
 		if (privacy_lists.default == name and origin.activePrivacyList == nil) or origin.activePrivacyList == name then
 			module:log("debug", "calling sendNeededUnavailablePresences!");
 			-- item is valid and list is active, so send needed unavailable stanzas
@@ -324,7 +324,7 @@
 		local privacy_lists = datamanager.load(origin.username, origin.host, "privacy") or {};
 
 		if stanza.attr.type == "set" then
-			if #query.tags == 1 then --  the <query/> element MUST NOT include more than one child element 
+			if #query.tags == 1 then --  the <query/> element MUST NOT include more than one child element
 				for _,tag in ipairs(query.tags) do
 					if tag.name == "active" or tag.name == "default" then
 						if tag.attr.name == nil then -- Client declines the use of active / default list
@@ -383,13 +383,13 @@
 		if privacy_lists.lists == nil or
 			(session.activePrivacyList == nil or session.activePrivacyList == "") and
 			(privacy_lists.default == nil     or privacy_lists.default == "")
-		then 
+		then
 			return; -- Nothing to block, default is Allow all
 		end
 		if jid_bare(stanza.attr.from) == bare_jid and jid_bare(stanza.attr.to) == bare_jid then
 			module:log("debug", "Never block communications from one of a user's resources to another.");
 			return; -- from one of a user's resource to another => HANDS OFF!
-		end 
+		end
 
 		local idx;
 		local list;
@@ -430,7 +430,7 @@
 					module:log("debug", "evil jid is (to): %s", stanza.attr.to);
 					evilJid.node, evilJid.host, evilJid.resource = jid_split(stanza.attr.to);
 				end
-				if	item.type == "jid" and 
+				if	item.type == "jid" and
 					(evilJid.node and evilJid.host and evilJid.resource and item.value == evilJid.node.."@"..evilJid.host.."/"..evilJid.resource) or
 					(evilJid.node and evilJid.host and item.value == evilJid.node.."@"..evilJid.host) or
 					(evilJid.host and evilJid.resource and item.value == evilJid.host.."/"..evilJid.resource) or