rostermanager: Variable rename for clarity and to avoid name clash [luacheck]
authorMatthew Wild <mwild1@gmail.com>
Wed, 6 May 2015 18:17:59 +0000 (19:17 +0100)
committerMatthew Wild <mwild1@gmail.com>
Wed, 6 May 2015 18:17:59 +0000 (19:17 +0100)
core/rostermanager.lua

index 612a349fd9adccd7382f82399f34cd43f3253436..a9b26f23892d5b5b1079b309e149fc980992feb0 100644 (file)
@@ -213,10 +213,10 @@ end
 function is_contact_subscribed(username, host, jid)
        do
                local selfjid = username.."@"..host;
-               local subscription = _get_online_roster_subscription(selfjid, jid);
-               if subscription then return (subscription == "both" or subscription == "from"); end
-               local subscription = _get_online_roster_subscription(jid, selfjid);
-               if subscription then return (subscription == "both" or subscription == "to"); end
+               local user_subscription = _get_online_roster_subscription(selfjid, jid);
+               if user_subscription then return (user_subscription == "both" or user_subscription == "from"); end
+               local contact_subscription = _get_online_roster_subscription(jid, selfjid);
+               if contact_subscription then return (contact_subscription == "both" or contact_subscription == "to"); end
        end
        local roster, err = load_roster(username, host);
        local item = roster[jid];