aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pep_plus.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-08 23:42:55 +0200
committerKim Alvefur <zash@zash.se>2017-10-08 23:42:55 +0200
commit15e642083432061b90857bc2b78f486d7cacd9e4 (patch)
tree52e9fd22c81abded28e1b91277f860fdc4c28e6d /plugins/mod_pep_plus.lua
parent93aefe9a45afd448c53018b3e4c34a687ebafc50 (diff)
downloadprosody-15e642083432061b90857bc2b78f486d7cacd9e4.tar.gz
prosody-15e642083432061b90857bc2b78f486d7cacd9e4.zip
mod_pep_plus: Rename variable for clarity
Diffstat (limited to 'plugins/mod_pep_plus.lua')
-rw-r--r--plugins/mod_pep_plus.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/mod_pep_plus.lua b/plugins/mod_pep_plus.lua
index e366b859..b9ff3098 100644
--- a/plugins/mod_pep_plus.lua
+++ b/plugins/mod_pep_plus.lua
@@ -279,10 +279,10 @@ module:hook("presence/bare", function(event)
local origin, stanza = event.origin, event.stanza;
local user = stanza.attr.to or (origin.username..'@'..origin.host);
local t = stanza.attr.type;
- local self = not stanza.attr.to;
+ local is_self = not stanza.attr.to;
if not t then -- available presence
- if self or subscription_presence(user, stanza.attr.from) then
+ if is_self or subscription_presence(user, stanza.attr.from) then
local recipient = stanza.attr.from;
local current = recipients[user] and recipients[user][recipient];
local hash, query_node = get_caps_hash_from_presence(stanza, current);
@@ -296,7 +296,7 @@ module:hook("presence/bare", function(event)
else
recipients[user][recipient] = hash;
local from_bare = origin.type == "c2s" and origin.username.."@"..origin.host;
- if self or origin.type ~= "c2s" or (recipients[from_bare] and recipients[from_bare][origin.full_jid]) ~= hash then
+ if is_self or origin.type ~= "c2s" or (recipients[from_bare] and recipients[from_bare][origin.full_jid]) ~= hash then
-- COMPAT from ~= stanza.attr.to because OneTeam can't deal with missing from attribute
origin.send(
st.stanza("iq", {from=user, to=stanza.attr.from, id="disco", type="get"})
@@ -308,7 +308,7 @@ module:hook("presence/bare", function(event)
end
elseif t == "unavailable" then
update_subscriptions(stanza.attr.from, user);
- elseif not self and t == "unsubscribe" then
+ elseif not is_self and t == "unsubscribe" then
local from = jid_bare(stanza.attr.from);
local subscriptions = recipients[user];
if subscriptions then
@@ -329,7 +329,7 @@ module:hook("iq-result/bare/disco", function(event)
end
-- Process disco response
- local self = not stanza.attr.to;
+ local is_self = not stanza.attr.to;
local user = stanza.attr.to or (origin.username..'@'..origin.host);
local contact = stanza.attr.from;
local current = recipients[user] and recipients[user][contact];
@@ -346,7 +346,7 @@ module:hook("iq-result/bare/disco", function(event)
end
end
hash_map[ver] = notify; -- update hash map
- if self then
+ if is_self then
for jid, item in pairs(origin.roster) do -- for all interested contacts
if item.subscription == "both" or item.subscription == "from" then
if not recipients[jid] then recipients[jid] = {}; end