mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 11:19:51 +00:00
FIX: Remove quoted post text and block realtime replies from ignored users (#7336)
This commit is contained in:
parent
02394e9170
commit
5957991340
@ -223,7 +223,7 @@ export default class PostCooked {
|
||||
.trim()
|
||||
.slice(0, -1);
|
||||
if (username.length > 0 && this.ignoredUsers.includes(username)) {
|
||||
$aside.find("p").replaceWith(`<i>${I18n.t("post.ignored")}</i>`);
|
||||
$aside.find("p").remove();
|
||||
}
|
||||
}
|
||||
$(".quote-controls", $aside).html(expandContract + navLink);
|
||||
|
@ -659,14 +659,6 @@ export default createWidget("post", {
|
||||
} else {
|
||||
classNames.push("regular");
|
||||
}
|
||||
if (
|
||||
this.currentUser &&
|
||||
this.currentUser.ignored_users &&
|
||||
this.currentUser.ignored_users.length > 0 &&
|
||||
this.currentUser.ignored_users.includes(attrs.username)
|
||||
) {
|
||||
classNames.push("post-ignored");
|
||||
}
|
||||
if (addPostClassesCallbacks) {
|
||||
for (let i = 0; i < addPostClassesCallbacks.length; i++) {
|
||||
let pluginClasses = addPostClassesCallbacks[i].call(this, attrs);
|
||||
|
@ -46,9 +46,10 @@ export default Ember.Component.extend({
|
||||
return `/presence/topic/${topicId}`;
|
||||
},
|
||||
|
||||
@computed("presenceUsers", "currentUser.id")
|
||||
users(users, currentUserId) {
|
||||
return (users || []).filter(user => user.id !== currentUserId);
|
||||
@computed("presenceUsers", "currentUser.{id,ignored_users}")
|
||||
users(users, currentUser) {
|
||||
const ignoredUsers = currentUser.ignored_users || [];
|
||||
return (users || []).filter(user => user.id !== currentUser.id && !ignoredUsers.includes(user.username));
|
||||
},
|
||||
|
||||
shouldDisplay: Ember.computed.gt("users.length", 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user