From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: alina sireneva <alina@tei.su>
Date: Sun, 19 Apr 2026 05:33:38 +0300
Subject: added some missing Emoji.replaceEmoji calls in various places

---
 .../ui/ActionBar/ActionBarMenuItem.java       | 16 +++++++++++-
 .../telegram/ui/Cells/AudioPlayerCell.java    |  5 +++-
 .../org/telegram/ui/Cells/ChatActionCell.java |  2 ++
 .../org/telegram/ui/Cells/DialogCell.java     |  1 +
 .../ui/Cells/GroupCallInvitedCell.java        |  5 +++-
 .../telegram/ui/Cells/GroupCallUserCell.java  |  5 +++-
 .../telegram/ui/Cells/ManageChatUserCell.java |  3 ++-
 .../telegram/ui/Cells/MemberRequestCell.java  |  9 +++++--
 .../org/telegram/ui/Cells/MentionCell.java    |  2 ++
 .../org/telegram/ui/Cells/SharedLinkCell.java |  6 ++++-
 .../ui/Cells/SharingLiveLocationCell.java     |  2 +-
 .../telegram/ui/ChannelAdminLogActivity.java  |  3 ++-
 .../java/org/telegram/ui/ChatActivity.java    | 26 ++++++++++++-------
 .../ui/Components/AudioPlayerAlert.java       |  3 +++
 .../telegram/ui/Components/EditTextEmoji.java |  2 +-
 .../telegram/ui/Components/ItemOptions.java   | 13 ++++++----
 .../ui/Components/MessagePreviewView.java     |  4 ++-
 .../ui/Components/SenderSelectPopup.java      | 12 ++++++---
 .../org/telegram/ui/LocationActivity.java     |  4 ++-
 .../org/telegram/ui/MainTabsActivity.java     |  3 ++-
 .../org/telegram/ui/MessageAuthorView.java    |  4 ++-
 .../java/org/telegram/ui/MessageSeenView.java |  7 +++--
 .../java/org/telegram/ui/PhotoViewer.java     |  1 +
 .../org/telegram/ui/SettingsActivity.java     |  6 +++--
 .../recorder/CaptionContainerView.java        | 13 ++++++++++
 25 files changed, 119 insertions(+), 38 deletions(-)

diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarMenuItem.java
@@ -28,6 +28,7 @@ import android.text.Editable;
 import android.text.TextUtils;
 import android.text.TextWatcher;
 import android.text.method.LinkMovementMethod;
+import android.text.style.ImageSpan;
 import android.transition.ChangeBounds;
 import android.transition.Transition;
 import android.transition.TransitionManager;
@@ -64,6 +65,7 @@ import androidx.core.view.WindowInsetsCompat;
 import org.telegram.messenger.AndroidUtilities;
 import org.telegram.messenger.AnimationNotificationsLocker;
 import org.telegram.messenger.ChatObject;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.LocaleController;
 import org.telegram.messenger.R;
 import org.telegram.messenger.UserConfig;
@@ -1525,6 +1527,8 @@ public class ActionBarMenuItem extends FrameLayout {
                 return false;
             });
             searchField.addTextChangedListener(new TextWatcher() {
+                private boolean processChange;
+
                 @Override
                 public void beforeTextChanged(CharSequence s, int start, int count, int after) {
 
@@ -1546,11 +1550,21 @@ public class ActionBarMenuItem extends FrameLayout {
                             onFiltersChanged();
                         }
                     }
+                    if ((count - before) > 1) {
+                        processChange = true;
+                    }
                 }
 
                 @Override
                 public void afterTextChanged(Editable s) {
-
+                    if (processChange) {
+                        ImageSpan[] spans = s.getSpans(0, s.length(), ImageSpan.class);
+                        for (int i = 0; i < spans.length; i++) {
+                            s.removeSpan(spans[i]);
+                        }
+                        Emoji.replaceEmoji(s, searchField.getPaint().getFontMetricsInt(), false, null);
+                        processChange = false;
+                    }
                 }
             });
 
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/AudioPlayerCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/AudioPlayerCell.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/AudioPlayerCell.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/AudioPlayerCell.java
@@ -30,12 +30,14 @@ import android.widget.ImageView;
 
 import org.telegram.messenger.AndroidUtilities;
 import org.telegram.messenger.DownloadController;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.FileLoader;
 import org.telegram.messenger.FileLog;
 import org.telegram.messenger.ImageLoader;
 import org.telegram.messenger.LocaleController;
 import org.telegram.messenger.MediaController;
 import org.telegram.messenger.MessageObject;
+import org.telegram.messenger.NotificationCenter;
 import org.telegram.messenger.R;
 import org.telegram.messenger.SharedConfig;
 import org.telegram.messenger.UserConfig;
@@ -93,6 +95,7 @@ public class AudioPlayerCell extends FrameLayout implements DownloadController.F
         this.setWillNotDraw(false);
         this.resourcesProvider = resourcesProvider;
         this.viewType = viewType;
+        NotificationCenter.listenEmojiLoading(this);
 
         optionsButton = new ImageView(context);
         optionsButton.setScaleType(ImageView.ScaleType.CENTER);
@@ -144,7 +147,7 @@ public class AudioPlayerCell extends FrameLayout implements DownloadController.F
             CharSequence authorFinal = TextUtils.ellipsize(author, Theme.chat_contextResult_descriptionTextPaint, maxWidth, TextUtils.TruncateAt.END);
             CharSequence authorFinalH = AndroidUtilities.highlightText(authorFinal, currentMessageObject.highlightedWords, resourcesProvider);
             if (authorFinalH == null) authorFinalH = authorFinal;
-            descriptionLayout = new StaticLayout(authorFinalH, Theme.chat_contextResult_descriptionTextPaint, maxWidth + dp(4), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
+            descriptionLayout = new StaticLayout(Emoji.replaceEmoji(authorFinalH, Theme.chat_contextResult_descriptionTextPaint.getFontMetricsInt(), false), Theme.chat_contextResult_descriptionTextPaint, maxWidth + dp(4), Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
             descriptionLayoutEmojis = AnimatedEmojiSpan.update(AnimatedEmojiDrawable.CACHE_TYPE_MESSAGES, this, descriptionLayoutEmojis, descriptionLayout);
         } catch (Exception e) {
             FileLog.e(e);
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ChatActionCell.java
@@ -1728,6 +1728,8 @@ public class ChatActionCell extends BaseCell implements DownloadController.FileD
 
             text = Emoji.replaceEmoji(text, paint.getFontMetricsInt(), false, null,
                 DynamicDrawableSpan.ALIGN_BOTTOM, 0.85f, 0);
+        } else {
+            text = Emoji.replaceEmoji(text, paint.getFontMetricsInt(), false, null);
         }
 
         textLayout = new StaticLayout(text, paint, maxWidth,
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java
@@ -2658,6 +2658,7 @@ public class DialogCell extends BaseCell implements StoriesListPlaceProvider.Ava
             }
         } else if ((useForceThreeLines || SharedConfig.useThreeLinesLayout) && !hasTags() && messageNameString != null && (currentDialogFolderId == 0 || currentDialogFolderDialogsCount == 1)) {
             try {
+                messageNameString = Emoji.replaceEmoji(messageNameString, Theme.dialogs_messageNamePaint.getFontMetricsInt(), false);
                 if (message != null && message.hasHighlightedWords()) {
                     CharSequence s = AndroidUtilities.highlightText(messageNameString, message.highlightedWords, resourcesProvider);
                     if (s != null) {
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/GroupCallInvitedCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/GroupCallInvitedCell.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/GroupCallInvitedCell.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/GroupCallInvitedCell.java
@@ -10,8 +10,10 @@ import android.widget.FrameLayout;
 import android.widget.ImageView;
 
 import org.telegram.messenger.AndroidUtilities;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.LocaleController;
 import org.telegram.messenger.MessagesController;
+import org.telegram.messenger.NotificationCenter;
 import org.telegram.messenger.R;
 import org.telegram.messenger.UserObject;
 import org.telegram.tgnet.TLRPC;
@@ -52,6 +54,7 @@ public class GroupCallInvitedCell extends FrameLayout {
         addView(avatarImageView, LayoutHelper.createFrame(46, 46, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 0 : 11, 6, LocaleController.isRTL ? 11 : 0, 0));
 
         nameTextView = new SimpleTextView(context);
+        NotificationCenter.listenEmojiLoading(nameTextView);
         nameTextView.setTextColor(Theme.getColor(Theme.key_voipgroup_nameText));
         nameTextView.setTypeface(AndroidUtilities.bold());
         nameTextView.setTextSize(16);
@@ -90,7 +93,7 @@ public class GroupCallInvitedCell extends FrameLayout {
             avatarDrawable.setInfo(currentUser);
         }
 
-        nameTextView.setText(UserObject.getUserName(currentUser));
+        nameTextView.setText(Emoji.replaceEmoji(UserObject.getUserName(currentUser), nameTextView.getPaint().getFontMetricsInt(), false));
         avatarImageView.getImageReceiver().setCurrentAccount(account);
         avatarImageView.setForUserOrChat(currentUser, avatarDrawable);
 
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/GroupCallUserCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/GroupCallUserCell.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/GroupCallUserCell.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/GroupCallUserCell.java
@@ -30,10 +30,12 @@ import org.telegram.messenger.AccountInstance;
 import org.telegram.messenger.AndroidUtilities;
 import org.telegram.messenger.ChatObject;
 import org.telegram.messenger.DialogObject;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.ImageLocation;
 import org.telegram.messenger.LiteMode;
 import org.telegram.messenger.LocaleController;
 import org.telegram.messenger.MessageObject;
+import org.telegram.messenger.NotificationCenter;
 import org.telegram.messenger.R;
 import org.telegram.messenger.UserObject;
 import org.telegram.messenger.Utilities;
@@ -290,6 +292,7 @@ public class GroupCallUserCell extends FrameLayout {
         AndroidUtilities.updateViewVisibilityAnimated(avatarProgressView, false, 1f, false);
 
         nameTextView = new SimpleTextView(context);
+        NotificationCenter.listenEmojiLoading(nameTextView);
         nameTextView.setTextColor(Theme.getColor(Theme.key_voipgroup_nameText));
         nameTextView.setTypeface(AndroidUtilities.bold());
         nameTextView.setTextSize(16);
@@ -477,7 +480,7 @@ public class GroupCallUserCell extends FrameLayout {
             currentChat = null;
             avatarDrawable.setInfo(accountInstance.getCurrentAccount(), currentUser);
 
-            nameTextView.setText(UserObject.getUserName(currentUser));
+            nameTextView.setText(Emoji.replaceEmoji(UserObject.getUserName(currentUser), nameTextView.getPaint().getFontMetricsInt(), false));
             botVerificationIcon = DialogObject.getBotVerificationIcon(currentUser);
             if (currentUser != null && currentUser.verified) {
                 rightDrawable.set(verifiedDrawable = (verifiedDrawable == null ? new VerifiedDrawable(getContext()) : verifiedDrawable), animated);
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ManageChatUserCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ManageChatUserCell.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ManageChatUserCell.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ManageChatUserCell.java
@@ -116,6 +116,7 @@ public class ManageChatUserCell extends FrameLayout {
         statusTextView.setTextSize(14);
         statusTextView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP);
         addView(statusTextView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 20, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 28 : (68 + namePadding), 34.5f, LocaleController.isRTL ? (68 + namePadding) : 28, 0));
+        NotificationCenter.listenEmojiLoading(statusTextView);
 
         if (needOption) {
             optionsButton = new ImageView(context);
@@ -172,7 +173,7 @@ public class ManageChatUserCell extends FrameLayout {
             avatarImageView.setImageDrawable(null);
             return;
         }
-        currentStatus = status;
+        currentStatus = status != null ? Emoji.replaceEmoji(status, statusTextView.getPaint().getFontMetricsInt(), false) : null;
         currentName = name;
         currentObject = object;
         if (optionsButton != null) {
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/MemberRequestCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/MemberRequestCell.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/MemberRequestCell.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/MemberRequestCell.java
@@ -12,7 +12,9 @@ import android.widget.TextView;
 import androidx.annotation.NonNull;
 
 import org.telegram.messenger.AndroidUtilities;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.LocaleController;
+import org.telegram.messenger.NotificationCenter;
 import org.telegram.messenger.R;
 import org.telegram.messenger.UserObject;
 import org.telegram.tgnet.TLRPC;
@@ -38,6 +40,9 @@ public class MemberRequestCell extends FrameLayout {
         avatarImageView.setRoundRadius(AndroidUtilities.dp(23));
         addView(avatarImageView, LayoutHelper.createFrame(46, 46, LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT, 12, 8, 12, 0));
 
+        NotificationCenter.listenEmojiLoading(nameTextView);
+        NotificationCenter.listenEmojiLoading(statusTextView);
+
         nameTextView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT);
         nameTextView.setMaxLines(1);
         nameTextView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
@@ -98,7 +103,7 @@ public class MemberRequestCell extends FrameLayout {
         TLRPC.User user = users.get(importer.user_id);
         avatarDrawable.setInfo(user);
         avatarImageView.setForUserOrChat(user, avatarDrawable);
-        nameTextView.setText(UserObject.getUserName(user));
+        nameTextView.setText(Emoji.replaceEmoji(UserObject.getUserName(user), nameTextView.getPaint().getFontMetricsInt(), false));
         String dateText = LocaleController.formatDateAudio(importer.date, false);
         if (importer.via_chatlist) {
             statusTextView.setText(LocaleController.getString(R.string.JoinedViaFolder));
@@ -107,7 +112,7 @@ public class MemberRequestCell extends FrameLayout {
         } else {
             TLRPC.User approvedByUser = users.get(importer.approved_by);
             if (approvedByUser != null) {
-                statusTextView.setText(LocaleController.formatString("AddedBy", R.string.AddedBy, UserObject.getFirstName(approvedByUser), dateText));
+                statusTextView.setText(Emoji.replaceEmoji(LocaleController.formatString("AddedBy", R.string.AddedBy, UserObject.getFirstName(approvedByUser), dateText), statusTextView.getPaint().getFontMetricsInt(), false));
             } else {
                 statusTextView.setText("");
             }
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/MentionCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/MentionCell.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/MentionCell.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/MentionCell.java
@@ -24,6 +24,7 @@ import android.widget.TextView;
 import org.telegram.messenger.ChatObject;
 import org.telegram.messenger.Emoji;
 import org.telegram.messenger.MediaDataController;
+import org.telegram.messenger.NotificationCenter;
 import org.telegram.messenger.R;
 import org.telegram.messenger.UserConfig;
 import org.telegram.messenger.UserObject;
@@ -65,6 +66,7 @@ public class MentionCell extends LinearLayout {
                 super.setText(text, type);
             }
         };
+        NotificationCenter.listenEmojiLoading(nameTextView);
         nameTextView.setTextColor(getThemedColor(Theme.key_windowBackgroundWhiteBlackText));
         nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
         nameTextView.setSingleLine(true);
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedLinkCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedLinkCell.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedLinkCell.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharedLinkCell.java
@@ -42,6 +42,7 @@ import org.telegram.messenger.ImageReceiver;
 import org.telegram.messenger.LocaleController;
 import org.telegram.messenger.MediaDataController;
 import org.telegram.messenger.MessageObject;
+import org.telegram.messenger.NotificationCenter;
 import org.telegram.messenger.RichMessageLayout;
 import org.telegram.tgnet.TLRPC;
 import org.telegram.tgnet.tl.TL_iv;
@@ -199,6 +200,7 @@ public class SharedLinkCell extends FrameLayout {
         this.resourcesProvider = resourcesProvider;
         this.viewType = viewType;
         setFocusable(true);
+        NotificationCenter.listenEmojiLoading(this);
 
         titleTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
         titleTextPaint.setTypeface(AndroidUtilities.bold());
@@ -454,7 +456,7 @@ public class SharedLinkCell extends FrameLayout {
 
         if (title != null) {
             try {
-                CharSequence titleFinal = title;
+                CharSequence titleFinal = Emoji.replaceEmoji(title, titleTextPaint.getFontMetricsInt(), false);
                 CharSequence titleH = AndroidUtilities.highlightText(titleFinal, message.highlightedWords, null);
                 if (titleH != null) {
                     titleFinal = titleH;
@@ -479,6 +481,7 @@ public class SharedLinkCell extends FrameLayout {
 
         if (description != null) {
             try {
+                description = Emoji.replaceEmoji(description, descriptionTextPaint.getFontMetricsInt(), false);
                 descriptionLayout = ChatMessageCell.generateStaticLayout(description, descriptionTextPaint, maxWidth, maxWidth, 0, desctiptionLines);
                 if (descriptionLayout.getLineCount() > 0) {
                     description2Y = descriptionY + descriptionLayout.getLineBottom(descriptionLayout.getLineCount() - 1) + dp(5);
@@ -494,6 +497,7 @@ public class SharedLinkCell extends FrameLayout {
 
         if (description2 != null) {
             try {
+                description2 = Emoji.replaceEmoji(description2, descriptionTextPaint.getFontMetricsInt(), false);
                 descriptionLayout2 = ChatMessageCell.generateStaticLayout(description2, descriptionTextPaint, maxWidth, maxWidth, 0, desctiptionLines);
                 if (descriptionLayout != null) {
                     description2Y += dp(10);
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharingLiveLocationCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharingLiveLocationCell.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharingLiveLocationCell.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/SharingLiveLocationCell.java
@@ -312,7 +312,7 @@ public class SharingLiveLocationCell extends FrameLayout {
             combinedDrawable.setIconSize(dp(24), dp(24));
             avatarImageView.setImageDrawable(combinedDrawable);
         }
-        nameTextView.setText(name);
+        nameTextView.setText(Emoji.replaceEmoji(name, nameTextView.getTextPaint().getFontMetricsInt(), true));
 
         location.setLatitude(messageObject.messageOwner.media.geo.lat);
         location.setLongitude(messageObject.messageOwner.media.geo._long);
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChannelAdminLogActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChannelAdminLogActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/ChannelAdminLogActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/ChannelAdminLogActivity.java
@@ -85,6 +85,7 @@ import org.telegram.messenger.BuildVars;
 import org.telegram.messenger.ChatObject;
 import org.telegram.messenger.ContactsController;
 import org.telegram.messenger.DialogObject;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.FileLoader;
 import org.telegram.messenger.FileLog;
 import org.telegram.messenger.ImageLocation;
@@ -793,7 +794,7 @@ public class ChannelAdminLogActivity extends BaseFragment implements Notificatio
             ssb.append(" S");
             ssb.setSpan(new ColoredImageSpan(drawable), ssb.length() - 1, ssb.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
         }
-        messageObject.messageText = ssb;
+        messageObject.messageText = Emoji.replaceEmoji(ssb, Theme.chat_msgTextPaint.getFontMetricsInt(), false);
         MessageObject lastMessage = messages.size() <= 0 ? null : messages.get(messages.size() - 1);
         if (lastMessage != null) {
             if (!stableIdByEventExpand.containsKey(lastMessage.eventId))
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
@@ -15312,11 +15312,11 @@ public class ChatActivity extends BaseFragment implements
                             }
                         }
                         if (userNamesCount == 1) {
-                            mess = TextUtils.concat(userNames, ": ", mess);
+                            mess = TextUtils.concat(Emoji.replaceEmoji(userNames, replyObjectTextView.getPaint().getFontMetricsInt(), false), ": ", mess);
                         }
                         replyObjectTextView.setText(mess);
                     } else {
-                        replyObjectTextView.setText(LocaleController.formatString("ForwardingFromNames", R.string.ForwardingFromNames, userNames));
+                        replyObjectTextView.setText(Emoji.replaceEmoji(LocaleController.formatString("ForwardingFromNames", R.string.ForwardingFromNames, userNames), replyObjectTextView.getPaint().getFontMetricsInt(), false));
                     }
                 }
                 replyObjectHintTextView.setText(LocaleController.getString(R.string.TapForForwardingOptions));
@@ -15348,20 +15348,20 @@ public class ChatActivity extends BaseFragment implements
                     replyObjectTextView.setText(pendingLinkSearchString);
                 } else {
                     if (webPage.site_name != null) {
-                        replyNameTextView.setText(webPage.site_name);
+                        replyNameTextView.setText(Emoji.replaceEmoji(webPage.site_name, replyObjectTextView.getPaint().getFontMetricsInt(), false));
                     } else if (webPage.title != null) {
-                        replyNameTextView.setText(webPage.title);
+                        replyNameTextView.setText(Emoji.replaceEmoji(webPage.title, replyObjectTextView.getPaint().getFontMetricsInt(), false));
                     } else {
                         replyNameTextView.setText(LocaleController.getString(R.string.LinkPreview));
                     }
                     if (webPage.title != null) {
-                        replyObjectTextView.setText(webPage.title);
+                        replyObjectTextView.setText(Emoji.replaceEmoji(webPage.title, replyObjectTextView.getPaint().getFontMetricsInt(), false));
                     } else if (webPage.description != null) {
-                        replyObjectTextView.setText(webPage.description);
+                        replyObjectTextView.setText(Emoji.replaceEmoji(webPage.description, replyObjectTextView.getPaint().getFontMetricsInt(), false));
                     } else if (webPage.author != null) {
-                        replyObjectTextView.setText(webPage.author);
+                        replyObjectTextView.setText(Emoji.replaceEmoji(webPage.author, replyObjectTextView.getPaint().getFontMetricsInt(), false));
                     } else {
-                        replyObjectTextView.setText(webPage.display_url);
+                        replyObjectTextView.setText(Emoji.replaceEmoji(webPage.display_url, replyObjectTextView.getPaint().getFontMetricsInt(), false));
                     }
                     chatActivityEnterView.setWebPage(webPage, true);
                 }
@@ -21881,6 +21881,10 @@ public class ChatActivity extends BaseFragment implements
             if (chatListView != null) {
                 chatListView.invalidateViews();
             }
+            if (replyLayout != null) {
+                replyLayout.current().name.invalidate();
+                replyLayout.current().obj.invalidate();
+            }
             if (alertTextView != null) {
                 alertTextView.invalidate();
             }
@@ -28593,6 +28597,7 @@ public class ChatActivity extends BaseFragment implements
                 pinnedMessageObject.updateTranslation(false);
                 if (pinnedMessageObject.type == MessageObject.TYPE_MUSIC) {
                     pinnedText = String.format("%s - %s", pinnedMessageObject.getMusicAuthor(), pinnedMessageObject.getMusicTitle());
+                    pinnedText = Emoji.replaceEmoji(pinnedText, messageTextView.getPaint().getFontMetricsInt(), false);
                 } else if (pinnedMessageObject.type == MessageObject.TYPE_POLL) {
                     if (pinnedMessageObject.messageOwner.media instanceof TLRPC.TL_messageMediaPoll) {
                         TLRPC.TL_messageMediaPoll poll = (TLRPC.TL_messageMediaPoll) pinnedMessageObject.messageOwner.media;
@@ -40234,15 +40239,16 @@ public class ChatActivity extends BaseFragment implements
                 userButton.addView(imageView, LayoutHelper.createFrame(34, 34, Gravity.LEFT | Gravity.CENTER_VERTICAL, 13, 0, 0, 0));
 
                 final TextView titleText = new TextView(getContext());
+                NotificationCenter.listenEmojiLoading(titleText);
                 titleText.setTextColor(getThemedColor(Theme.key_dialogTextBlack));
                 titleText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
                 titleText.setEllipsize(TextUtils.TruncateAt.END);
                 titleText.setSingleLine(true);
                 if (obj instanceof TLRPC.User) {
-                    titleText.setText(UserObject.getUserName((TLRPC.User) obj));
+                    titleText.setText(Emoji.replaceEmoji(UserObject.getUserName((TLRPC.User) obj), titleText.getPaint().getFontMetricsInt(), false));
                 } else if (obj instanceof TLRPC.Chat) {
                     TLRPC.Chat chat = (TLRPC.Chat) obj;
-                    titleText.setText(chat.title);
+                    titleText.setText(Emoji.replaceEmoji(chat.title, titleText.getPaint().getFontMetricsInt(), false));
                 }
                 userButton.addView(titleText, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.FILL_HORIZONTAL | Gravity.TOP, 59, 6, 16, 0));
 
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/AudioPlayerAlert.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/AudioPlayerAlert.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Components/AudioPlayerAlert.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/AudioPlayerAlert.java
@@ -76,6 +76,7 @@ import org.telegram.messenger.BuildVars;
 import org.telegram.messenger.ContactsController;
 import org.telegram.messenger.DialogObject;
 import org.telegram.messenger.DownloadController;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.FileLoader;
 import org.telegram.messenger.FileLog;
 import org.telegram.messenger.FileRefController;
@@ -3324,6 +3325,7 @@ public class AudioPlayerAlert extends BottomSheet implements NotificationCenter.
                     textViews[i].setAlpha(0f);
                     textViews[i].setVisibility(GONE);
                 }
+                NotificationCenter.listenEmojiLoading(textViews[i]);
                 addView(textViews[i], LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT));
             }
             gradientMatrix = new Matrix();
@@ -3427,6 +3429,7 @@ public class AudioPlayerAlert extends BottomSheet implements NotificationCenter.
         }
 
         public void setText(CharSequence text, boolean animated) {
+            text = Emoji.replaceEmoji(text, textViews[activeIndex].getPaint().getFontMetricsInt(), false);
             final CharSequence currentText = textViews[activeIndex].getText();
 
             if (TextUtils.isEmpty(currentText) || !animated) {
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEmoji.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEmoji.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEmoji.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextEmoji.java
@@ -74,7 +74,7 @@ public class EditTextEmoji extends FrameLayout implements NotificationCenter.Not
     private boolean showKeyboardOnResume;
     private int lastSizeChangeValue1;
     private boolean lastSizeChangeValue2;
-    private int innerTextChange;
+    public int innerTextChange;
     private boolean allowAnimatedEmoji;
     public boolean includeNavigationBar;
     AdjustPanLayoutHelper adjustPanLayoutHelper;
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ItemOptions.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ItemOptions.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ItemOptions.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ItemOptions.java
@@ -586,13 +586,14 @@ public class ItemOptions {
 
         ActionBarMenuSubItem subItem = new ActionBarMenuSubItem(context, false, false, resourcesProvider);
         subItem.setPadding(dp(18), 0, dp(18), 0);
+        NotificationCenter.listenEmojiLoading(subItem.textView);
         if (obj instanceof TLRPC.Chat) {
             TLRPC.Chat chat = (TLRPC.Chat) obj;
-            subItem.setText(chat == null ? "" : chat.title);
+            subItem.setText(chat == null ? "" : Emoji.replaceEmoji(chat.title, subItem.textView.getPaint().getFontMetricsInt(), false));
             subItem.setSubtext(ChatObject.isChannelAndNotMegaGroup(chat) ? getString(R.string.DiscussChannel) : getString(R.string.AccDescrGroup).toLowerCase());
         } else if (obj instanceof TLRPC.User) {
             TLRPC.User user = (TLRPC.User) obj;
-            subItem.setText(UserObject.getUserName(user));
+            subItem.setText(Emoji.replaceEmoji(UserObject.getUserName(user), subItem.textView.getPaint().getFontMetricsInt(), false));
             if (user.id == UserConfig.getInstance(UserConfig.selectedAccount).getClientUserId()) {
                 subItem.setSubtext(getString(R.string.VoipGroupPersonalAccount));
             } else if (UserObject.isBot(user)) {
@@ -649,7 +650,8 @@ public class ItemOptions {
 
         ActionBarMenuSubItem subItem = new ActionBarMenuSubItem(context, false, false, resourcesProvider);
         subItem.setPadding(dp(18), 0, dp(18), 0);
-        subItem.setText(UserObject.getUserName(user));
+        NotificationCenter.listenEmojiLoading(subItem.textView);
+        subItem.setText(Emoji.replaceEmoji(UserObject.getUserName(user), subItem.textView.getPaint().getFontMetricsInt(), false));
 
         subItem.setClipToPadding(false);
         subItem.textView.setPadding(subItem.checkViewLeft ? (subItem.checkView != null ? dp(43) : 0) : dp(43), 0, subItem.checkViewLeft ? dp(43) : (subItem.checkView != null ? dp(43) : 0), 0);
@@ -875,15 +877,16 @@ public class ItemOptions {
         userButton.addView(imageView, LayoutHelper.createFrame(34, 34, Gravity.LEFT | Gravity.CENTER_VERTICAL, 13, 0, 0, 0));
 
         final TextView titleText = new TextView(context);
+        NotificationCenter.listenEmojiLoading(titleText);
         titleText.setTextColor(Theme.getColor(Theme.key_dialogTextBlack, resourcesProvider));
         titleText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
         titleText.setEllipsize(TextUtils.TruncateAt.END);
         titleText.setSingleLine(true);
         if (obj instanceof TLRPC.User) {
-            titleText.setText(UserObject.getUserName((TLRPC.User) obj));
+            titleText.setText(Emoji.replaceEmoji(UserObject.getUserName((TLRPC.User) obj), titleText.getPaint().getFontMetricsInt(), false));
         } else if (obj instanceof TLRPC.Chat) {
             TLRPC.Chat chat = (TLRPC.Chat) obj;
-            titleText.setText(chat.title);
+            titleText.setText(Emoji.replaceEmoji(chat.title, titleText.getPaint().getFontMetricsInt(), false));
         }
         userButton.addView(titleText, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.FILL_HORIZONTAL | Gravity.TOP, 59, 6, 16, 0));
 
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/MessagePreviewView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/MessagePreviewView.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Components/MessagePreviewView.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/MessagePreviewView.java
@@ -46,6 +46,7 @@ import org.telegram.messenger.BuildVars;
 import org.telegram.messenger.ChatMessageSharedResources;
 import org.telegram.messenger.ChatObject;
 import org.telegram.messenger.ContactsController;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.FileLog;
 import org.telegram.messenger.MessagePreviewParams;
 import org.telegram.messenger.LocaleController;
@@ -2227,6 +2228,7 @@ public class MessagePreviewView extends FrameLayout {
             subtitle.setEllipsizeByGradient(!LocaleController.isRTL);
             subtitle.setCallback(this);
             subtitle.setOverrideFullWidth(AndroidUtilities.displaySize.x);
+            NotificationCenter.listenEmojiLoading(this);
         }
 
         public void setAnimationForward(boolean forward) {
@@ -2239,7 +2241,7 @@ public class MessagePreviewView extends FrameLayout {
         }
 
         public void setSubtitle(CharSequence text, boolean animated) {
-            subtitle.setText(text, animated && !LocaleController.isRTL);
+            subtitle.setText(Emoji.replaceEmoji(text, subtitle.getPaint().getFontMetricsInt(), false), animated && !LocaleController.isRTL);
         }
 
         @Override
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/SenderSelectPopup.java
@@ -12,7 +12,7 @@ import android.graphics.Typeface;
 import android.graphics.drawable.Drawable;
 import android.os.Build;
 import android.text.Spannable;
-import android.text.SpannableString;
+import android.text.SpannableStringBuilder;
 import android.text.TextUtils;
 import android.util.TypedValue;
 import android.view.Gravity;
@@ -37,8 +37,10 @@ import androidx.recyclerview.widget.RecyclerView;
 
 import org.telegram.messenger.AndroidUtilities;
 import org.telegram.messenger.ChatObject;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.LocaleController;
 import org.telegram.messenger.MessagesController;
+import org.telegram.messenger.NotificationCenter;
 import org.telegram.messenger.R;
 import org.telegram.messenger.UserConfig;
 import org.telegram.messenger.UserObject;
@@ -184,7 +186,8 @@ public class SenderSelectPopup extends ActionBarPopupWindow {
                     TLRPC.Chat chat = messagesController.getChat(-peerId);
                     if (chat != null) {
                         if (peerObj.premium_required) {
-                            SpannableString str = new SpannableString(TextUtils.ellipsize(chat.title, senderView.title.getPaint(), maxWidth - AndroidUtilities.dp(100), TextUtils.TruncateAt.END) + " d");
+                            SpannableStringBuilder str = new SpannableStringBuilder(Emoji.replaceEmoji(TextUtils.ellipsize(chat.title, senderView.title.getPaint(), maxWidth - AndroidUtilities.dp(100), TextUtils.TruncateAt.END), senderView.title.getPaint().getFontMetricsInt(), false));
+                            str.append(" d");
                             ColoredImageSpan span = new ColoredImageSpan(R.drawable.msg_mini_premiumlock);
                             span.setTopOffset(1);
                             span.setSize(AndroidUtilities.dp(14));
@@ -195,7 +198,7 @@ public class SenderSelectPopup extends ActionBarPopupWindow {
                             senderView.title.setText(str);
                         } else {
                             senderView.title.setEllipsize(TextUtils.TruncateAt.END);
-                            senderView.title.setText(chat.title);
+                            senderView.title.setText(Emoji.replaceEmoji(chat.title, senderView.title.getPaint().getFontMetricsInt(), false));
                         }
                         senderView.subtitle.setText(LocaleController.formatPluralString(ChatObject.isChannel(chat) && !chat.megagroup ? "Subscribers" : "Members", chat.participants_count));
                         senderView.avatar.setAvatar(chat);
@@ -204,7 +207,7 @@ public class SenderSelectPopup extends ActionBarPopupWindow {
                 } else {
                     TLRPC.User user = messagesController.getUser(peerId);
                     if (user != null) {
-                        senderView.title.setText(UserObject.getUserName(user));
+                        senderView.title.setText(Emoji.replaceEmoji(UserObject.getUserName(user), senderView.title.getPaint().getFontMetricsInt(), false));
                         senderView.subtitle.setText(LocaleController.getString(R.string.VoipGroupPersonalAccount));
                         senderView.avatar.setAvatar(user);
                     }
@@ -530,6 +533,7 @@ public class SenderSelectPopup extends ActionBarPopupWindow {
             addView(textRow, LayoutHelper.createLinear(0, LayoutHelper.MATCH_PARENT, 1f, 12, 0, 0, 0));
 
             title = new TextView(context);
+            NotificationCenter.listenEmojiLoading(title);
             title.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem, resourcesProvider));
             title.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
             title.setTag(this.title);
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java
@@ -70,6 +70,7 @@ import org.telegram.messenger.ApplicationLoader;
 import org.telegram.messenger.BuildVars;
 import org.telegram.messenger.ChatObject;
 import org.telegram.messenger.DialogObject;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.FileLog;
 import org.telegram.messenger.IMapsProvider;
 import org.telegram.messenger.ImageReceiver;
@@ -922,6 +923,7 @@ public class LocationActivity extends BaseFragment implements NotificationCenter
         }
 
         hintView = new HintView2(context, HintView2.DIRECTION_TOP);
+        NotificationCenter.listenEmojiLoading(hintView);
         hintView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
         hintView.setDuration(4000);
         hintView.setJoint(1, -(12 + 13));
@@ -2318,7 +2320,7 @@ public class LocationActivity extends BaseFragment implements NotificationCenter
             preferences.edit().putInt("proximityhint", ++val).commit();
             if (DialogObject.isUserDialog(dialogId)) {
                 TLRPC.User user = getMessagesController().getUser(dialogId);
-                hintView.setText(LocaleController.formatString("ProximityTooltioUser", R.string.ProximityTooltioUser, UserObject.getFirstName(user)));
+                hintView.setText(Emoji.replaceEmoji(LocaleController.formatString("ProximityTooltioUser", R.string.ProximityTooltioUser, UserObject.getFirstName(user)), hintView.getTextPaint().getFontMetricsInt(), false));
             } else {
                 hintView.setText(getString(R.string.ProximityTooltioGroup));
             }
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MainTabsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MainTabsActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/MainTabsActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/MainTabsActivity.java
@@ -748,9 +748,10 @@ public class MainTabsActivity extends ViewPagerActivity implements NotificationC
         final TextView textView = new TextView(getContext());
         textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
         textView.setTextColor(getThemedColor(Theme.key_dialogTextBlack));
-        textView.setText(UserObject.getUserName(user));
+        textView.setText(Emoji.replaceEmoji(UserObject.getUserName(user), textView.getPaint().getFontMetricsInt(), false));
         textView.setMaxLines(2);
         textView.setEllipsize(TextUtils.TruncateAt.END);
+        NotificationCenter.listenEmojiLoading(textView);
         btn.addView(textView, LayoutHelper.createLinear(0, LayoutHelper.WRAP_CONTENT, 1f, Gravity.CENTER_VERTICAL, 13, 0, 14, 0));
 
         return btn;
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessageAuthorView.java b/TMessagesProj/src/main/java/org/telegram/ui/MessageAuthorView.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/MessageAuthorView.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/MessageAuthorView.java
@@ -30,6 +30,7 @@ import org.telegram.messenger.ImageLocation;
 import org.telegram.messenger.LocaleController;
 import org.telegram.messenger.MessageObject;
 import org.telegram.messenger.MessagesController;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.NotificationCenter;
 import org.telegram.messenger.R;
 import org.telegram.messenger.UserConfig;
@@ -75,6 +76,7 @@ public class MessageAuthorView extends FrameLayout {
         addView(flickerLoadingView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT));
 
         titleView = new LinkSpanDrawable.LinksTextView(context);
+        NotificationCenter.listenEmojiLoading(titleView);
         titleView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
         titleView.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL);
         titleView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem));
@@ -140,7 +142,7 @@ public class MessageAuthorView extends FrameLayout {
         setEnabled(user != null);
         if (user != null) {
             final long userId = user.id;
-            titleView.setText(AndroidUtilities.premiumText(LocaleController.formatString(R.string.MessageAuthorSentBy, UserObject.getUserName(user)), () -> openUser(userId)));
+            titleView.setText(Emoji.replaceEmoji(AndroidUtilities.premiumText(LocaleController.formatString(R.string.MessageAuthorSentBy, UserObject.getUserName(user)), () -> openUser(userId)), titleView.getPaint().getFontMetricsInt(), false));
         }
         titleView.animate().alpha(1f).setDuration(220).start();
         flickerLoadingView.animate().alpha(0f).setDuration(220).setListener(new HideViewAfterAnimation(flickerLoadingView)).start();
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessageSeenView.java b/TMessagesProj/src/main/java/org/telegram/ui/MessageSeenView.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/MessageSeenView.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/MessageSeenView.java
@@ -24,6 +24,7 @@ import androidx.recyclerview.widget.RecyclerView;
 import org.telegram.messenger.AndroidUtilities;
 import org.telegram.messenger.ChatObject;
 import org.telegram.messenger.ContactsController;
+import org.telegram.messenger.Emoji;
 import org.telegram.messenger.ImageLocation;
 import org.telegram.messenger.LocaleController;
 import org.telegram.messenger.MessageObject;
@@ -78,6 +79,7 @@ public class MessageSeenView extends FrameLayout {
         titleView.setTextSize(16);
         titleView.setEllipsizeByGradient(true);
         titleView.setRightPadding(AndroidUtilities.dp(62));
+        NotificationCenter.listenEmojiLoading(titleView);
 
         addView(titleView, LayoutHelper.createFrame(0, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.CENTER_VERTICAL, 40, 0, 0, 0));
 
@@ -269,7 +271,7 @@ public class MessageSeenView extends FrameLayout {
 
         avatarsImageView.commitTransition(false);
         if (peerIds.size() == 1 && users.get(0) != null) {
-            titleView.setText(ContactsController.formatName(users.get(0)));
+            titleView.setText(Emoji.replaceEmoji(ContactsController.formatName(users.get(0)), titleView.getPaint().getFontMetricsInt(), false));
         } else {
             if (peerIds.size() == 0) {
                 titleView.setText(LocaleController.getString(R.string.NobodyViewed));
@@ -375,6 +377,7 @@ public class MessageSeenView extends FrameLayout {
             nameView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
             nameView.setTextColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem));
             nameView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT);
+            NotificationCenter.listenEmojiLoading(nameView);
 
             statusBadgeComponent = new StatusBadgeComponent(this);
             nameView.setDrawablePadding(AndroidUtilities.dp(3));
@@ -415,7 +418,7 @@ public class MessageSeenView extends FrameLayout {
                 avatarDrawable.setInfo(currentAccount, object);
                 ImageLocation imageLocation = ImageLocation.getForUserOrChat(currentAccount, object, ImageLocation.TYPE_SMALL);
                 avatarImageView.setImage(imageLocation, "50_50", avatarDrawable, object);
-                nameView.setText(ContactsController.formatName(object));
+                nameView.setText(Emoji.replaceEmoji(ContactsController.formatName(object), nameView.getPaint().getFontMetricsInt(), false));
             }
 
             if (date <= 0) {
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java
@@ -15272,6 +15272,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
             navigationBar.setBackgroundColor(fancyShadows ? (sendPhotoType == SELECT_TYPE_STICKER ? 0x66000000 : 0) : (sendPhotoType == SELECT_TYPE_STICKER ? 0xFF000000 : 0x7f000000));
         }
         if (title != null) {
+            title = Emoji.replaceEmoji(title, actionBarContainer.titleTextView[0].getPaint().getFontMetricsInt(), false);
             if (animated) {
                 if (wasIndex == index) {
                     actionBarContainer.setTitleAnimated(title, true, true);
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java
@@ -459,6 +459,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
         titleView.setGravity(Gravity.CENTER);
         titleView.setSingleLine();
         titleView.setEllipsize(TextUtils.TruncateAt.END);
+        NotificationCenter.listenEmojiLoading(titleView);
         topView.addView(titleView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL | Gravity.TOP, 16, 138.333f - 12, 16, 0));
 
         subtitleView = new TextView(context);
@@ -535,7 +536,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
 
         avatarDrawable.setInfo(user);
         avatarView.setForUserOrChat(user, avatarDrawable);
-        titleView.setText(UserObject.getUserName(user));
+        titleView.setText(Emoji.replaceEmoji(UserObject.getUserName(user), titleView.getPaint().getFontMetricsInt(), false));
         final StringBuilder sb = new StringBuilder();
         if (user != null) {
             sb.append(PhoneFormat.getInstance().format("+" + user.phone));
@@ -976,6 +977,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
             textView.setTextSize(15);
             textView.setTypeface(AndroidUtilities.bold());
             textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText, resourcesProvider));
+            NotificationCenter.listenEmojiLoading(textView);
 
             botDrawable = new AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable(textView, dp(24), AnimatedEmojiDrawable.CACHE_TYPE_EMOJI_STATUS);
             emojiStatusDrawable = new AnimatedEmojiDrawable.SwapAnimatedEmojiDrawable(textView, dp(24), AnimatedEmojiDrawable.CACHE_TYPE_EMOJI_STATUS);
@@ -1039,7 +1041,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
             avatarDrawable.setInfo(account, user);
             avatarView.getImageReceiver().setCurrentAccount(account);
             avatarView.setForUserOrChat(user, avatarDrawable);
-            textView.setText(UserObject.getUserName(user));
+            textView.setText(Emoji.replaceEmoji(UserObject.getUserName(user), textView.getPaint().getFontMetricsInt(), false));
 
             botDrawable.setCurrentAccount(account);
             emojiStatusDrawable.setCurrentAccount(account);
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Stories/recorder/CaptionContainerView.java b/TMessagesProj/src/main/java/org/telegram/ui/Stories/recorder/CaptionContainerView.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Stories/recorder/CaptionContainerView.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Stories/recorder/CaptionContainerView.java
@@ -33,6 +33,7 @@ import android.text.Editable;
 import android.text.SpannableStringBuilder;
 import android.text.TextPaint;
 import android.text.TextWatcher;
+import android.text.style.ImageSpan;
 import android.view.Gravity;
 import android.view.MotionEvent;
 import android.view.RoundedCorner;
@@ -346,6 +347,9 @@ public class CaptionContainerView extends FrameLayout {
                 if (editText.getEditText().suppressOnTextChanged) {
                     return;
                 }
+                if (editText.innerTextChange != 2 && (count - before) > 1) {
+                    processChange = true;
+                }
                 if (mentionContainer == null) {
                     createMentionsContainer();
                 }
@@ -357,9 +361,18 @@ public class CaptionContainerView extends FrameLayout {
 
             private int lastLength;
             private boolean lastOverLimit;
+            private boolean processChange;
 
             @Override
             public void afterTextChanged(Editable s) {
+                if (processChange) {
+                    ImageSpan[] spans = s.getSpans(0, s.length(), ImageSpan.class);
+                    for (int i = 0; i < spans.length; i++) {
+                        s.removeSpan(spans[i]);
+                    }
+                    Emoji.replaceEmoji(s, editText.getEditText().getPaint().getFontMetricsInt(), false, null);
+                    processChange = false;
+                }
                 codePointCount = Character.codePointCount(s, 0, s.length());
                 String limitText = null;
                 final int limit = getCaptionLimit();
