Mercurial > prosody-hg
changeset 14188:dbbafef0748f
util.pubsub: Recreate intermediate tables if necessary when restoring old subscription state
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 25 May 2026 21:14:24 +0100 |
| parents | 4f12f98c2ec1 |
| children | e58de351880f |
| files | util/pubsub.lua |
| diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/util/pubsub.lua Mon May 25 21:08:09 2026 +0100 +++ b/util/pubsub.lua Mon May 25 21:14:24 2026 +0100 @@ -543,6 +543,12 @@ -- Restore previous in-memory state node_obj.subscribers[jid] = old_subscription; node_obj.pending_subscribers[jid] = pending_subscription; + if not self.subscriptions[normal_jid] then + self.subscriptions[normal_jid] = {}; + end + if not self.subscriptions[normal_jid][jid] then + self.subscriptions[normal_jid][jid] = {}; + end if pending_subscription then self.subscriptions[normal_jid][jid][node] = false; elseif old_subscription then
