Skip to content

Commit

Permalink
Fix outgoing "filter" on middleware
Browse files Browse the repository at this point in the history
hookOutgoing doesn't exist, but emit("send", element) does.
  • Loading branch information
singpolyma committed Nov 14, 2023
1 parent 8ad208e commit 82b1456
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 82b1456

Please sign in to comment.