comparison util/pubsub.lua @ 14187:4f12f98c2ec1

util.pubsub: Use correct table when reverting unsuccessful subscription approval
author Matthew Wild <mwild1@gmail.com>
date Mon, 25 May 2026 21:08:09 +0100
parents d975d280baec
children dbbafef0748f
comparison
equal deleted inserted replaced
14186:d975d280baec 14187:4f12f98c2ec1
480 local ok, err = save_node_to_store(self, node_obj); -- luacheck: ignore 211/err 480 local ok, err = save_node_to_store(self, node_obj); -- luacheck: ignore 211/err
481 if not ok then 481 if not ok then
482 -- Store failed, revert in-memory to old subscription 482 -- Store failed, revert in-memory to old subscription
483 node_obj.subscribers[jid] = old_subscription; 483 node_obj.subscribers[jid] = old_subscription;
484 self.subscriptions[normal_jid][jid][node] = old_subscription and true or nil; 484 self.subscriptions[normal_jid][jid][node] = old_subscription and true or nil;
485 self.pending_subscribers[normal_jid] = pending_subscription; 485 node_obj.pending_subscribers[normal_jid] = pending_subscription;
486 return ok, "internal-server-error"; 486 return ok, "internal-server-error";
487 end 487 end
488 end 488 end
489 489
490 self.events.fire_event("subscription-added", { service = self, node = node, jid = jid, normalized_jid = normal_jid, options = options }); 490 self.events.fire_event("subscription-added", { service = self, node = node, jid = jid, normalized_jid = normal_jid, options = options });