Skip to content

Clean and modify interface of functions in zulip_bots/lib.py to work for Embedded bots. #81

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

abhijeetkaur
Copy link
Member

No description provided.

Names are not guaranteed to be unique, user ids should
be used when comparing if the sender and receiver are the same.
This is done so that Embedded bot system can also make use of
this function directly, as only id is needed in this function.

Also, there would be ambiguity as what type of BotHandler is
passed in the arguments: EmbeddedBotHandler or ExternalBotHandler.
This is done so that Embedded bot system can also make use of
this function directly, as only client name is needed in this function,
and the type of client need not be ExternalBotHandler.

Also, there would be ambiguity as what type of BotHandler is
passed in the arguments: EmbeddedBotHandler or ExternalBotHandler.
Extract code and make an independent function to check and remove
at-mention string (if the message is not a private message).

This is done so that Embedded bots can also use this piece of
code.
@abhijeetkaur abhijeetkaur changed the title Clean is_private function to work based on user IDs and modify interface to work for Embedded bots. Clean and modify interface of functions in zulip_bots/lib.py to work for Embedded bots. Aug 19, 2017
This function needs to be called by bots using additional specific
configurations stored either in a file (in the case of External bots)
or in the database (in case of Embedded bots).

Extracting this piece of code to make it usable independently.
@zulipbot
Copy link
Member

Heads up @abhijeetkaur, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

@timabbott
Copy link
Member

I merged the first bit of this, after some changes to variable names etc. Want to spend some more time thinking about the rest.

@showell
Copy link
Contributor

showell commented Nov 16, 2017

@abhijeetkaur This looks great, but you need to fix a merge conflict! Thanks!

@zulipbot
Copy link
Member

Heads up @abhijeetkaur, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

@PIG208
Copy link
Member

PIG208 commented Jun 14, 2021

We need to merge this PR after tweaking it a little bit. As embedded bots will not work in private groups otherwise.

We also need to note that the change needs to be reflected in the server. The function is_private_message_but_not_group_pm commented that "This function is used by the embedded bot system in the zulip/zulip project, so refactor with care", but it is, in fact, not used yet. We need to do a follow-up in zerver/worker/queue_processors.py.

Yet it's stale, I think we can reuse some of the code here.

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

Successfully merging this pull request may close these issues.

5 participants