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

CallOnEachEvent narrows #110

Open
palaga opened this issue Oct 16, 2024 · 1 comment
Open

CallOnEachEvent narrows #110

palaga opened this issue Oct 16, 2024 · 1 comment

Comments

@palaga
Copy link
Contributor

palaga commented Oct 16, 2024

Currently callOnEachEvent only allows me to specify the types of events I'm interested in, but not let me narrow down the messages I receive. According to this page, the python API does allow narrowing.

@palaga
Copy link
Contributor Author

palaga commented Oct 22, 2024

Let me elaborate a little more on the narrow issue. I did not expect it to be part of the callOnEachEvent API, as they're specific to events of type message. Yet they seem to be part of the python API (see link posted earlier). So, I would expect the same behavior from the js API.

My primary use-case would be to filter out messages send by myself, to prevent an endless reply loop. Currently, I retrieve the current user profile at startup and then ignore all events of type message where the sender_id matches my ID. This works, but it would be nice if I could offload this logic to the zulip server, by defining a narrow (i.e. -sender:me). It would also further reduce bandwidth. For this specific use-case bandwidth savings are marginal, but could be more significant in other cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant