Software / code / prosody
Comparison
util/pubsub.lua @ 8382:e5d00bf4a4d5
util: Various minor changes to please [luacheck]
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 10 Nov 2017 05:42:32 +0100 |
| parent | 8376:eb6a9c314c86 |
| child | 8401:f1923a79c93d |
comparison
equal
deleted
inserted
replaced
| 8381:7f6184474149 | 8382:e5d00bf4a4d5 |
|---|---|
| 172 if next(subs) == nil then | 172 if next(subs) == nil then |
| 173 self.subscriptions[normal_jid] = nil; | 173 self.subscriptions[normal_jid] = nil; |
| 174 end | 174 end |
| 175 end | 175 end |
| 176 self.events.fire_event("subscription-removed", { node = node, jid = jid, normalized_jid = normal_jid }); | 176 self.events.fire_event("subscription-removed", { node = node, jid = jid, normalized_jid = normal_jid }); |
| 177 return true; | |
| 178 end | |
| 179 | |
| 180 function service:remove_all_subscriptions(actor, jid) | |
| 181 local normal_jid = self.config.normalize_jid(jid); | |
| 182 local subs = self.subscriptions[normal_jid] | |
| 183 subs = subs and subs[jid]; | |
| 184 if subs then | |
| 185 for node in pairs(subs) do | |
| 186 self:remove_subscription(node, true, jid); | |
| 187 end | |
| 188 end | |
| 189 return true; | 177 return true; |
| 190 end | 178 end |
| 191 | 179 |
| 192 function service:get_subscription(node, actor, jid) | 180 function service:get_subscription(node, actor, jid) |
| 193 -- Access checking | 181 -- Access checking |