From 15e642083432061b90857bc2b78f486d7cacd9e4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 8 Oct 2017 23:42:55 +0200 Subject: mod_pep_plus: Rename variable for clarity --- plugins/mod_pep_plus.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins') 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 -- cgit v1.2.3