Mercurial > prosody-hg
comparison core/rostermanager.lua @ 6662:5ef319efedba
rostermanager: Variable rename for clarity and to avoid name clash [luacheck]
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 06 May 2015 19:17:59 +0100 |
| parents | 7f9b49f2758a |
| children | 6236668da30a |
comparison
equal
deleted
inserted
replaced
| 6661:90e846e8a788 | 6662:5ef319efedba |
|---|---|
| 211 return item and item.subscription; | 211 return item and item.subscription; |
| 212 end | 212 end |
| 213 function is_contact_subscribed(username, host, jid) | 213 function is_contact_subscribed(username, host, jid) |
| 214 do | 214 do |
| 215 local selfjid = username.."@"..host; | 215 local selfjid = username.."@"..host; |
| 216 local subscription = _get_online_roster_subscription(selfjid, jid); | 216 local user_subscription = _get_online_roster_subscription(selfjid, jid); |
| 217 if subscription then return (subscription == "both" or subscription == "from"); end | 217 if user_subscription then return (user_subscription == "both" or user_subscription == "from"); end |
| 218 local subscription = _get_online_roster_subscription(jid, selfjid); | 218 local contact_subscription = _get_online_roster_subscription(jid, selfjid); |
| 219 if subscription then return (subscription == "both" or subscription == "to"); end | 219 if contact_subscription then return (contact_subscription == "both" or contact_subscription == "to"); end |
| 220 end | 220 end |
| 221 local roster, err = load_roster(username, host); | 221 local roster, err = load_roster(username, host); |
| 222 local item = roster[jid]; | 222 local item = roster[jid]; |
| 223 return item and (item.subscription == "from" or item.subscription == "both"), err; | 223 return item and (item.subscription == "from" or item.subscription == "both"), err; |
| 224 end | 224 end |
