Mercurial > prosody-hg
comparison plugins/mod_pep_plus.lua @ 8753:d6373a378b73
mod_pep_plus: Skip getting PEP service instance for sessions that have not touched PEP
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 11 Apr 2018 15:52:13 +0200 |
| parents | 41c959c5c84b |
| children | d00ea07de9a0 |
comparison
equal
deleted
inserted
replaced
| 8752:8f2da579a790 | 8753:d6373a378b73 |
|---|---|
| 266 if not id then return; end | 266 if not id then return; end |
| 267 service.config.broadcaster("items", node, { [jid] = true }, item); | 267 service.config.broadcaster("items", node, { [jid] = true }, item); |
| 268 end | 268 end |
| 269 | 269 |
| 270 local function update_subscriptions(recipient, service_name, nodes) | 270 local function update_subscriptions(recipient, service_name, nodes) |
| 271 local service = get_pep_service(service_name); | |
| 272 nodes = nodes or empty_set; | 271 nodes = nodes or empty_set; |
| 273 | 272 |
| 274 local service_recipients = recipients[service_name]; | 273 local service_recipients = recipients[service_name]; |
| 275 if not service_recipients then | 274 if not service_recipients then |
| 276 service_recipients = {}; | 275 service_recipients = {}; |
| 284 | 283 |
| 285 if (current == empty_set or current:empty()) and (nodes == empty_set or nodes:empty()) then | 284 if (current == empty_set or current:empty()) and (nodes == empty_set or nodes:empty()) then |
| 286 return; | 285 return; |
| 287 end | 286 end |
| 288 | 287 |
| 288 local service = get_pep_service(service_name); | |
| 289 for node in current - nodes do | 289 for node in current - nodes do |
| 290 service:remove_subscription(node, recipient, recipient); | 290 service:remove_subscription(node, recipient, recipient); |
| 291 end | 291 end |
| 292 | 292 |
| 293 for node in nodes - current do | 293 for node in nodes - current do |
