Skip to content

[WIP] - Mute topics from within ZT #467

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 6 commits into
base: main
Choose a base branch
from

Conversation

sumanthvrao
Copy link
Member

This PR adds support to mute topics from within ZT on M keypress:

  • The first commit here introduces API call to toggle muted status.
  • The second adds a method in core which builds the text and calls the PopUpconfirmationView
    with the model function passed in as callback.
  • We add functionality in buttons to restore/decrease unread count during appropriate events like (un)muting.
  • We register the handler for muted topic event which handeles and event-based approach as well. This intern calls the mark_(un)muted methods of each buttons.
  • We introduce the 'TOGGLE_MUTE_TOPIC' hotkey and maps it to its own category.
  • Last commit involve connecting the Key added earlier on a topic button so that it will be able to perform action of muting/unmuting a topic.

This handles updating muting/unmuting topics in a stream
by sending the request through the server through an
API class.
We make use of the PopUpConfirmation for confirming muting/unmuting topics,
using TopicButtons stream_id and topic names, displaying the affected
stream name and topic name of muting/unmuting being performed.
We want to be notified about changes in subscriptions like
muting/unmuting of topics in a stream, hence we register the
event_type 'muted_topics' to the event queue on startup, with a
handler method which responds to these events appropriately.

We store mappings between topic_name  and topic_buttons so
tha retrieval of buttons is easier when a change in topic muting
event occurs.
During muting of a topic:
* We decrease All_msg count by the correct amount
* If there are unread messages in the stream, we decrease its count by
  the same amount as well.

During unmuting of a topic:
* If there are unread messages in the stream, we replace
  'M' with the correct unread count.
* If there are no unread messages, we remove the marked 'M'
New section 'Topic list actions' created in README.

New 'topic_list' category created in keys for mapping keys
belonging to topic list actions.
On pressing TOGGLE_MUTE_TOPIC, we now ask for confirmation before
performing the action of muting/unmuting topics.
@zulipbot zulipbot added the size: XL [Automatic label added by zulipbot] label Aug 20, 2019
@sumanthvrao
Copy link
Member Author

Tests are yet to be added, but feedback is of-course welcome.
@neiljp @amanagr

@zulipbot
Copy link
Member

Heads up @sumanthvrao, 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.

Base automatically changed from master to main January 30, 2021 20:30
@mkp6781 mkp6781 mentioned this pull request Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has conflicts size: XL [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants