diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-02-09 06:49:03 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-02-09 06:49:03 +0000 |
commit | 192860d916e6ddf4dafc6d5c1add86fd7c636cf9 (patch) | |
tree | fdabace698b69b4145ce7ee55c6eb477797ab04f /plugins | |
parent | 9939a23f3281c329231f046f4faadf4c8b25df96 (diff) | |
download | prosody-192860d916e6ddf4dafc6d5c1add86fd7c636cf9.tar.gz prosody-192860d916e6ddf4dafc6d5c1add86fd7c636cf9.zip |
mod_privacy: Rename from_user/to_user flags to is_from_user/is_to_user for clarity
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_privacy.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/mod_privacy.lua b/plugins/mod_privacy.lua index ab1eb870..05ca01d6 100644 --- a/plugins/mod_privacy.lua +++ b/plugins/mod_privacy.lua @@ -379,8 +379,8 @@ function checkIfNeedToBeBlocked(e, session) local to = stanza.attr.to; local from = stanza.attr.from; - local to_user = bare_jid == jid_bare(to); - local from_user = bare_jid == jid_bare(from); + local is_to_user = bare_jid == jid_bare(to); + local is_from_user = bare_jid == jid_bare(from); module:log("debug", "stanza: %s, to: %s, from: %s", tostring(stanza.name), tostring(to), tostring(from)); @@ -390,7 +390,7 @@ function checkIfNeedToBeBlocked(e, session) then return; -- Nothing to block, default is Allow all end - if from_user and to_user then + if is_from_user and is_to_user then module:log("debug", "Not blocking communications between user's resources"); return; -- from one of a user's resource to another => HANDS OFF! end @@ -418,8 +418,8 @@ function checkIfNeedToBeBlocked(e, session) if ( (stanza.name == "message" and item.message) or (stanza.name == "iq" and item.iq) or - (stanza.name == "presence" and to_user and item["presence-in"]) or - (stanza.name == "presence" and from_user and item["presence-out"]) or + (stanza.name == "presence" and is_to_user and item["presence-in"]) or + (stanza.name == "presence" and is_from_user and item["presence-out"]) or (item.message == false and item.iq == false and item["presence-in"] == false and item["presence-out"] == false) ) then apply = true; @@ -427,7 +427,7 @@ function checkIfNeedToBeBlocked(e, session) if apply then local evilJid = {}; apply = false; - if to_user then + if is_to_user then module:log("debug", "evil jid is (from): %s", from); evilJid.node, evilJid.host, evilJid.resource = jid_split(from); else |