xmppjs / xmpp.js

XMPP for JavaScript
ISC License
2.19k stars 375 forks source link

Fix outgoing "filter" on middleware #1004

Open singpolyma opened 10 months ago

singpolyma commented 10 months ago

hookOutgoing doesn't exist, but emit("send", element) does.

singpolyma commented 10 months ago

middleware.filter is meant to (as I see in documentation) run on all outgoing stanzas in the same way as middleware.use runs on all incoming stanzas. However, without this patch it never runs at all because there is nothing that calls entity.hookOutgoing so this patch changes it to use the send event which actually does occur in the desired case.