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
[WIP] messages: Add a prompt for muted streams and topics. #2721
Conversation
Create a prompt that asks user if they want to unmute a stream or topic they want to post a message to. Fixes zulip#2083.
For node testing, I would mock out the 'subs.js' calls by doing something like this:
And then in specific tests you can do something like this:
|
Regarding Casper tests, obviously they would be nice to have, but I think they could be done as a follow-up issue. We do want to add as much node testing as possible here, so I would focus on structuring the code so that it's easy to test some of the individual moving parts with node tests. I've only kind of skimmed the code so far, but it seems reasonably well structured, but perhaps as you go deeper on the node tests, you'll find areas where you may want to move responsibilities to node-friendly modules. |
if (user_acknowledged_muted_context === undefined || | ||
user_acknowledged_muted_context === false) { | ||
unmute_context = [ "stream", stream_name ]; | ||
// this is only checked on send, whereas @all/@everyone mention is checked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment a copy/paste error?
@trueskawka this PR seems to have gotten lost in the chaos of GCI; want to rebase it and address Steve's comments so we can merge it? |
Hello @trueskawka, a Zulip maintainer reviewed this pull request over a week ago, but you haven't updated your pull request since. Please take a look at the requested changes and update your pull request accordingly. Thank you for your valuable contributions to Zulip! |
Heads up @trueskawka, 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 |
Hello @trueskawka, a Zulip maintainer reviewed this pull request over a week ago, but you haven't updated your pull request since. Please take a look at the requested changes and update your pull request accordingly. Thank you for your valuable contributions to Zulip! |
Hello @trueskawka, a Zulip maintainer reviewed this pull request over 7 days ago, but you haven't updated your pull request since. Please take a look at the requested changes and update your pull request accordingly. Thank you for your valuable contributions to Zulip! |
Heads up @trueskawka, 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 |
Hello @trueskawka, a Zulip maintainer reviewed this pull request over 10 days ago, but you haven't updated your pull request since. Please take a look at the requested changes and update your pull request accordingly. Thank you for your valuable contributions to Zulip! |
Hello @trueskawka, a Zulip maintainer reviewed this pull request over 10 days ago, but you haven't updated your pull request since. Please take a look at the requested changes and update your pull request accordingly. Thank you for your valuable contributions to Zulip! |
@trueskawka do you intend to pick this up soon? |
4ec3636
to
88b200c
Compare
Closing as a version of this was integrated in #24246. I hope you're doing well @trueskawka! |
Purpose
This PR creates a prompt that appears when a user tries to send a message to a stream or topic they've muted and asks them if they want to unmute it (yes/no) - in response to #2083.
Description
This is mostly based on existing functionality for a similar prompt for
@all
/@everyone
mentions. I've considered rewriting them into a single function, but decided against it, since we have autil.is_all_or_everyone_mentioned
and we're using it both when the@mention
is completed and when the user sends a message - with muted streams/topics I'm not sure we want to check them as soon as the user unfocuses the field (but we can also rewrite it to support this).The main differences are thus:
util.is_all_or_everyone_mentioned
additional prompt works with checking the status when the@mention
is completed,WIP
@timabbott @showell
js/subs
andjs/muting
(now I've realized I probably should usevar muting = require('js/muting.js');
). Is this the right place to test this feature or should I move it tonode_tests/muting.js
? I guess we could argue both approaches, as this is a feature both for composing messages and muting.