fix: Fix agent name in Twitter channel private note acting as a link (#4326)
This commit is contained in:
@@ -13,8 +13,9 @@ const TWITTER_HASH_REPLACEMENT =
|
||||
const USER_MENTIONS_REGEX = /mention:\/\/(user|team)\/(\d+)\/(.+)/gm;
|
||||
|
||||
class MessageFormatter {
|
||||
constructor(message, isATweet = false) {
|
||||
constructor(message, isATweet = false, isAPrivateNote = false) {
|
||||
this.message = DOMPurify.sanitize(escapeHtml(message || ''));
|
||||
this.isAPrivateNote = isAPrivateNote;
|
||||
this.isATweet = isATweet;
|
||||
this.marked = marked;
|
||||
|
||||
@@ -35,7 +36,7 @@ class MessageFormatter {
|
||||
}
|
||||
|
||||
formatMessage() {
|
||||
if (this.isATweet) {
|
||||
if (this.isATweet && !this.isAPrivateNote) {
|
||||
const withUserName = this.message.replace(
|
||||
TWITTER_USERNAME_REGEX,
|
||||
TWITTER_USERNAME_REPLACEMENT
|
||||
|
||||
Reference in New Issue
Block a user