mirror of
https://github.com/discourse/discourse.git
synced 2025-05-26 06:51:46 +08:00
FIX: Remove quoted post text and block realtime replies from ignored users (#7336)
This commit is contained in:

committed by
Régis Hanol

parent
02394e9170
commit
5957991340
@ -223,7 +223,7 @@ export default class PostCooked {
|
|||||||
.trim()
|
.trim()
|
||||||
.slice(0, -1);
|
.slice(0, -1);
|
||||||
if (username.length > 0 && this.ignoredUsers.includes(username)) {
|
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);
|
$(".quote-controls", $aside).html(expandContract + navLink);
|
||||||
|
@ -659,14 +659,6 @@ export default createWidget("post", {
|
|||||||
} else {
|
} else {
|
||||||
classNames.push("regular");
|
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) {
|
if (addPostClassesCallbacks) {
|
||||||
for (let i = 0; i < addPostClassesCallbacks.length; i++) {
|
for (let i = 0; i < addPostClassesCallbacks.length; i++) {
|
||||||
let pluginClasses = addPostClassesCallbacks[i].call(this, attrs);
|
let pluginClasses = addPostClassesCallbacks[i].call(this, attrs);
|
||||||
|
@ -46,9 +46,10 @@ export default Ember.Component.extend({
|
|||||||
return `/presence/topic/${topicId}`;
|
return `/presence/topic/${topicId}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("presenceUsers", "currentUser.id")
|
@computed("presenceUsers", "currentUser.{id,ignored_users}")
|
||||||
users(users, currentUserId) {
|
users(users, currentUser) {
|
||||||
return (users || []).filter(user => user.id !== currentUserId);
|
const ignoredUsers = currentUser.ignored_users || [];
|
||||||
|
return (users || []).filter(user => user.id !== currentUser.id && !ignoredUsers.includes(user.username));
|
||||||
},
|
},
|
||||||
|
|
||||||
shouldDisplay: Ember.computed.gt("users.length", 0)
|
shouldDisplay: Ember.computed.gt("users.length", 0)
|
||||||
|
Reference in New Issue
Block a user