Mercurial > prosody-hg
comparison core/rostermanager.lua @ 7780:dbd202e7c587
Merge 0.10->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 10 Dec 2016 02:55:38 +0100 |
| parents | b1f80447a2b1 |
| children | 8acc35b5355a |
comparison
equal
deleted
inserted
replaced
| 7768:57d0f2d3d5c5 | 7780:dbd202e7c587 |
|---|---|
| 232 end | 232 end |
| 233 local roster, err = load_roster(username, host); | 233 local roster, err = load_roster(username, host); |
| 234 local item = roster[jid]; | 234 local item = roster[jid]; |
| 235 return item and (item.subscription == "from" or item.subscription == "both"), err; | 235 return item and (item.subscription == "from" or item.subscription == "both"), err; |
| 236 end | 236 end |
| 237 local function is_user_subscribed(username, host, jid) | |
| 238 do | |
| 239 local selfjid = username.."@"..host; | |
| 240 local user_subscription = _get_online_roster_subscription(selfjid, jid); | |
| 241 if user_subscription then return (user_subscription == "both" or user_subscription == "to"); end | |
| 242 local contact_subscription = _get_online_roster_subscription(jid, selfjid); | |
| 243 if contact_subscription then return (contact_subscription == "both" or contact_subscription == "from"); end | |
| 244 end | |
| 245 local roster, err = load_roster(username, host); | |
| 246 local item = roster[jid]; | |
| 247 return item and (item.subscription == "to" or item.subscription == "both"), err; | |
| 248 end | |
| 237 | 249 |
| 238 function is_contact_pending_in(username, host, jid) | 250 function is_contact_pending_in(username, host, jid) |
| 239 local roster = load_roster(username, host); | 251 local roster = load_roster(username, host); |
| 240 return roster[false].pending[jid]; | 252 return roster[false].pending[jid]; |
| 241 end | 253 end |
| 348 save_roster = save_roster; | 360 save_roster = save_roster; |
| 349 process_inbound_subscription_approval = process_inbound_subscription_approval; | 361 process_inbound_subscription_approval = process_inbound_subscription_approval; |
| 350 process_inbound_subscription_cancellation = process_inbound_subscription_cancellation; | 362 process_inbound_subscription_cancellation = process_inbound_subscription_cancellation; |
| 351 process_inbound_unsubscribe = process_inbound_unsubscribe; | 363 process_inbound_unsubscribe = process_inbound_unsubscribe; |
| 352 is_contact_subscribed = is_contact_subscribed; | 364 is_contact_subscribed = is_contact_subscribed; |
| 365 is_user_subscribed = is_user_subscribed; | |
| 353 is_contact_pending_in = is_contact_pending_in; | 366 is_contact_pending_in = is_contact_pending_in; |
| 354 set_contact_pending_in = set_contact_pending_in; | 367 set_contact_pending_in = set_contact_pending_in; |
| 355 is_contact_pending_out = is_contact_pending_out; | 368 is_contact_pending_out = is_contact_pending_out; |
| 356 set_contact_pending_out = set_contact_pending_out; | 369 set_contact_pending_out = set_contact_pending_out; |
| 357 unsubscribe = unsubscribe; | 370 unsubscribe = unsubscribe; |
