Skip to content

Commit

Permalink
fix: reply-to user or channel name
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYi0526 committed Apr 14, 2024
2 parents f2a6599 + 070bafa commit fff86ab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3039,7 +3039,7 @@ public static String formatName(String firstName, String lastName, int maxLength
result.append(firstName);
}
}
return MessageHelper.INSTANCE.zalgoFilter(result);
return MessageHelper.INSTANCE.zalgoFilter(result.toString());
}

private class PhoneBookContact {
Expand Down
7 changes: 4 additions & 3 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8479,7 +8479,7 @@ private void showBotMessageHint(ChatMessageCell cell, boolean byClick) {
botMessageHint.show();
});
}

private void hideHints() {
if (savedMessagesTagHint != null && savedMessagesTagHint.shown()) {
savedMessagesTagHint.hide();
Expand Down Expand Up @@ -13885,8 +13885,9 @@ public void showFieldPanel(boolean show, MessageObject messageObjectToReply, Mes
}
nameText = AndroidUtilities.replaceCharSequence("%s", LocaleController.getString(R.string.ReplyTo), name == null ? "" : name);
}
nameText = MessageHelper.INSTANCE.zalgoFilter(nameText);
nameText = Emoji.replaceEmoji(nameText, replyNameTextView.getPaint().getFontMetricsInt(), false);
replyNameTextView.setText(MessageHelper.INSTANCE.zalgoFilter(name));
replyNameTextView.setText(nameText);
replyIconImageView.setContentDescription(LocaleController.getString("AccDescrReplying", R.string.AccDescrReplying));
replyCloseImageView.setContentDescription(LocaleController.getString("AccDescrCancelReply", R.string.AccDescrCancelReply));

Expand Down Expand Up @@ -39641,7 +39642,7 @@ public void updateClip(int[] clip) {
clip[1] = chatListView.getMeasuredHeight() - (chatListView.getPaddingBottom() - AndroidUtilities.dp(3));
}
}

private void updateVisibleWallpaperActions() {
if (chatListView != null && chatAdapter != null) {
for (int i = 0; i < chatListView.getChildCount(); ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,14 @@ object MessageHelper {
}

fun zalgoFilter(
text: CharSequence?
text: String
): String {
return if (text == null) {
""
} else {
zalgoFilter(
text.toString()
)
}
return zalgoFilter(text as CharSequence).toString()
}

fun zalgoFilter(
text: String?
): String {
text: CharSequence?
): CharSequence {
return if (text == null) {
""
} else if (NaConfig.zalgoFilter.Bool() && text.matches(
Expand Down

0 comments on commit fff86ab

Please sign in to comment.