Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

recent topics: Handle muted user avatars in participants.

Abhijeet Prasad Bodase5a339df25eb
diff --git a/frontend_tests/node_tests/people.js b/frontend_tests/node_tests/people.js
index a28bedf3938..a4af6c674c4 100644
--- a/frontend_tests/node_tests/people.js
+++ b/frontend_tests/node_tests/people.js
@@ -681,9 +681,11 @@ test_people("message_methods", () => {
"https://secure.gravatar.com/avatar/6dbdd7946b58d8b11351fcb27e5cdd55?d=identicon&s=50",
);
+ muting.add_muted_user(30);
assert.deepEqual(people.sender_info_for_recent_topics_row([30]), [
{
avatar_url_small: "/avatar/30&s=50",
+ is_muted: true,
full_name: me.full_name,
is_admin: false,
diff --git a/static/js/muting_ui.js b/static/js/muting_ui.js
index 308ebf0c1ac..45df71254a3 100644
--- a/static/js/muting_ui.js
+++ b/static/js/muting_ui.js
@@ -169,6 +169,10 @@ export function rerender_for_muted_user() {
activity.redraw();
pm_list.update_private_messages();
+
+ // If a user is (un)muted, we want to update their avatars on the recent topics
+ // participants column.
+ recent_topics.complete_rerender();
}
export function handle_user_updates(muted_user_ids) {
diff --git a/static/js/people.js b/static/js/people.js
index 491d111889a..f92f03cd9a7 100644
--- a/static/js/people.js
+++ b/static/js/people.js
@@ -662,6 +662,7 @@ export function sender_info_for_recent_topics_row(sender_ids) {
for (const id of sender_ids) {
const sender = {...get_by_user_id(id)};
sender.avatar_url_small = small_avatar_url_for_person(sender);
+ sender.is_muted = muting.is_user_muted(id);
senders_info.push(sender);
}
return senders_info;
diff --git a/static/templates/recent_topic_row.hbs b/static/templates/recent_topic_row.hbs
index 26788c03fcd..25e13b8536c 100644
--- a/static/templates/recent_topic_row.hbs
+++ b/static/templates/recent_topic_row.hbs
@@ -37,9 +37,15 @@
</li>
{{/if}}
{{#each senders}}
- <li class="recent_avatars_item" title="{{this.full_name}}">
- <img src="{{this.avatar_url_small}}" class="recent_avatars_img" />
- </li>
+ {{#if this.is_muted}}
+ <li class="recent_avatars_item" title="{{t 'Muted user'}}">
+ <span><i class="fa fa-user recent_avatars_others"></i></span>
+ </li>
+ {{else}}
+ <li class="recent_avatars_item" title="{{this.full_name}}">
+ <img src="{{this.avatar_url_small}}" class="recent_avatars_img" />
+ </li>
+ {{/if}}
{{/each}}
</ul>
</td>
diff --git a/templates/zerver/help/mute-a-user.md b/templates/zerver/help/mute-a-user.md
index 05d93682a9d..1af57e5a54d 100644
--- a/templates/zerver/help/mute-a-user.md
+++ b/templates/zerver/help/mute-a-user.md
@@ -36,6 +36,9 @@ have the following effects:
* Muted users are excluded from the autocomplete for composing a
private message or [mentioning a user](/help/mention-a-user-or-group).
+* Areas in Zulip which show users' avatars will now show a generic user symbol
+ in place of a muted user's profile picture.
+
* To avoid interfering with administration tasks, parts of the
settings UI (such as the list of subscribers to a stream, or members
of the organization) will display muted users' names and other