Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix outgoing "filter" on middleware #1004

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

singpolyma
Copy link
Contributor

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

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

@sonnyp sonnyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PRs

Can you clarify and explain a bit better this please?

@singpolyma
Copy link
Contributor Author

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.

Copy link
Member

@sonnyp sonnyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@xmpp/test also use the send event for catchOutgoing* 👍

@sonnyp sonnyp merged commit d5260a1 into xmppjs:main Dec 12, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants