Skip to content

Commit

Permalink
Fix outgoing "filter" on middleware (#1004)
Browse files Browse the repository at this point in the history
hookOutgoing doesn't exist, but emit("send", element) does.

Co-authored-by: Sonny Piers <sonny@fastmail.net>
  • Loading branch information
singpolyma and sonnyp authored Dec 12, 2024
1 parent ee848db commit d5260a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/middleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/test/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit d5260a1

Please sign in to comment.