From d5260a1d51f97cf00b277eef6292a127ed4184cb Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Thu, 12 Dec 2024 08:49:55 -0500 Subject: [PATCH] Fix outgoing "filter" on middleware (#1004) hookOutgoing doesn't exist, but emit("send", element) does. Co-authored-by: Sonny Piers --- packages/middleware/index.js | 2 +- packages/test/context.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/middleware/index.js b/packages/middleware/index.js index 10f9643b3..39a70dda4 100644 --- a/packages/middleware/index.js +++ b/packages/middleware/index.js @@ -28,7 +28,7 @@ module.exports = function middleware({ entity }) { const outgoingListener = listener(entity, outgoing, OutgoingContext); entity.on("element", incomingListener); - entity.hookOutgoing = outgoingListener; + entity.on("send", outgoingListener); return { use(fn) { diff --git a/packages/test/context.js b/packages/test/context.js index fd7727807..a78f85dab 100644 --- a/packages/test/context.js +++ b/packages/test/context.js @@ -139,7 +139,7 @@ module.exports = function context(entity = client()) { return this.sanitize(el).stanza; }, fakeOutgoing(el) { - entity.hookOutgoing(el); + entity.emit("send", el); }, mockInput(el) { entity.emit("input", el.toString());