Skip to content

Commit

Permalink
fix: reply-to user or channel name
Browse files Browse the repository at this point in the history
Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
  • Loading branch information
NextAlone committed Apr 13, 2024
1 parent 42c3043 commit b97af57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13679,8 +13679,9 @@ public void showFieldPanel(boolean show, MessageObject messageObjectToReply, Mes
}
nameText = AndroidUtilities.replaceCharSequence("%s", LocaleController.getString(R.string.ReplyTo), name == null ? "" : name);
}
nameText = StringUtils.zalgoFilter(nameText);
nameText = Emoji.replaceEmoji(nameText, replyNameTextView.getPaint().getFontMetricsInt(), false);
replyNameTextView.setText(StringUtils.zalgoFilter(name));
replyNameTextView.setText(nameText);
replyIconImageView.setContentDescription(LocaleController.getString("AccDescrReplying", R.string.AccDescrReplying));
replyCloseImageView.setContentDescription(LocaleController.getString("AccDescrCancelReply", R.string.AccDescrCancelReply));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ object StringUtils {
}

@JvmStatic
fun zalgoFilter(text: String?): String {
fun zalgoFilter(text: CharSequence?): CharSequence {
return if (text == null) {
""
} else if (Config.filterZalgo && text.matches(".*\\p{Mn}{4}.*".toRegex())) {
Expand All @@ -156,7 +156,7 @@ object StringUtils {
}

@JvmStatic
fun zalgoFilter(text: CharSequence?): String {
return zalgoFilter(text.toString())
fun zalgoFilter(text: String): String {
return zalgoFilter(text as CharSequence).toString()
}
}

0 comments on commit b97af57

Please sign in to comment.