From 16a95eb3fd1f8604e72c9cecaecbf8d80490f82d Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 8 Sep 2020 12:21:00 +0200 Subject: [PATCH] Dismiss messages from a mailbox when closing it --- www/common/outer/mailbox.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/common/outer/mailbox.js b/www/common/outer/mailbox.js index 7255b47c8..11c912a44 100644 --- a/www/common/outer/mailbox.js +++ b/www/common/outer/mailbox.js @@ -206,6 +206,10 @@ proxy.mailboxes = { if (!box) { return void cb(); } if (!box.cpNf || typeof(box.cpNf.stop) !== "function") { return void cb('EINVAL'); } box.cpNf.stop(); + Object.keys(box.content).forEach(function (h) { + Handlers.remove(ctx, box, box.content[h], h); + hideMessage(ctx, type, h, ctx.clients); + }); delete ctx.boxes[type]; }; var openChannel = function (ctx, type, m, onReady, opts) {