Skip to content

Commit

Permalink
fix: no-reply repeat with translated message
Browse files Browse the repository at this point in the history
Signed-off-by: Next Alone <[email protected]>
  • Loading branch information
NextAlone committed Dec 2, 2023
1 parent c36a15d commit bd83513
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -34347,12 +34347,30 @@ public boolean processRepeatMessage(boolean asCopy, boolean longClick) {
getSendMessagesHelper().sendSticker(selectedObject.getDocument(), null, dialog_id, replyToMsg, threadMessageObject, null, null, null, true, 0, false, null);
return true;
} else {
var message = messageObject.messageOwner.message;
String message;
ArrayList<TLRPC.MessageEntity> origin_entities;
if (messageObject.translated) {
if (messageObject.originalMessage instanceof String) {
message = (String) messageObject.originalMessage;
origin_entities = messageObject.messageOwner.entities;
} else if (messageObject.originalMessage instanceof Pair) {
Pair<String, ArrayList<TLRPC.MessageEntity>> pair =
(Pair<String, ArrayList<TLRPC.MessageEntity>>) messageObject.originalMessage;
message = pair.first;
origin_entities = pair.second;
} else {
message = messageObject.messageOwner.message;
origin_entities = messageObject.messageOwner.entities;
}
} else {
message = messageObject.messageOwner.message;
origin_entities = messageObject.messageOwner.entities;
}
if (!TextUtils.isEmpty(message)) {
ArrayList<TLRPC.MessageEntity> entities;
if (messageObject.messageOwner.entities != null && !messageObject.messageOwner.entities.isEmpty()) {
if (origin_entities != null && !origin_entities.isEmpty()) {
entities = new ArrayList<>();
for (TLRPC.MessageEntity entity : messageObject.messageOwner.entities) {
for (TLRPC.MessageEntity entity : origin_entities) {
if (entity instanceof TLRPC.TL_messageEntityMentionName) {
TLRPC.TL_inputMessageEntityMentionName mention = new TLRPC.TL_inputMessageEntityMentionName();
mention.length = entity.length;
Expand Down

0 comments on commit bd83513

Please sign in to comment.