From 6b09d463a840cdf5ef945ed227875b73f8acb618 Mon Sep 17 00:00:00 2001 From: NekoInverter <42698724+NekoInverter@users.noreply.github.com> Date: Fri, 28 Feb 2020 22:58:37 +0800 Subject: [PATCH] Fix no quote forward has reply --- .../org/telegram/messenger/SendMessagesHelper.java | 14 +++++++------- .../main/java/org/telegram/ui/ChatActivity.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java b/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java index 2a0b710db..610174cf7 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java @@ -990,7 +990,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe } } - public void processForwardFromMyName(MessageObject messageObject, long did) { + public void processForwardFromMyName(MessageObject messageObject, long did, boolean nullReply) { if (messageObject == null) { return; } @@ -1001,18 +1001,18 @@ public class SendMessagesHelper extends BaseController implements NotificationCe params.put("parentObject", "sent_" + messageObject.messageOwner.to_id.channel_id + "_" + messageObject.getId()); } if (messageObject.messageOwner.media.photo instanceof TLRPC.TL_photo) { - sendMessage((TLRPC.TL_photo) messageObject.messageOwner.media.photo, null, did, messageObject.replyMessageObject, messageObject.messageOwner.message, messageObject.messageOwner.entities, null, params, true, 0, messageObject.messageOwner.media.ttl_seconds, messageObject); + sendMessage((TLRPC.TL_photo) messageObject.messageOwner.media.photo, null, did, nullReply ? null : messageObject.replyMessageObject, messageObject.messageOwner.message, messageObject.messageOwner.entities, null, params, true, 0, messageObject.messageOwner.media.ttl_seconds, messageObject); } else if (messageObject.messageOwner.media.document instanceof TLRPC.TL_document) { - sendMessage((TLRPC.TL_document) messageObject.messageOwner.media.document, null, messageObject.messageOwner.attachPath, did, messageObject.replyMessageObject, messageObject.messageOwner.message, messageObject.messageOwner.entities, null, params, true, 0, messageObject.messageOwner.media.ttl_seconds, messageObject); + sendMessage((TLRPC.TL_document) messageObject.messageOwner.media.document, null, messageObject.messageOwner.attachPath, did, nullReply ? null : messageObject.replyMessageObject, messageObject.messageOwner.message, messageObject.messageOwner.entities, null, params, true, 0, messageObject.messageOwner.media.ttl_seconds, messageObject); } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaVenue || messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo) { - sendMessage(messageObject.messageOwner.media, did, messageObject.replyMessageObject, null, null, true, 0); + sendMessage(messageObject.messageOwner.media, did, nullReply ? null : messageObject.replyMessageObject, null, null, true, 0); } else if (messageObject.messageOwner.media.phone_number != null) { TLRPC.User user = new TLRPC.TL_userContact_old2(); user.phone = messageObject.messageOwner.media.phone_number; user.first_name = messageObject.messageOwner.media.first_name; user.last_name = messageObject.messageOwner.media.last_name; user.id = messageObject.messageOwner.media.user_id; - sendMessage(user, did, messageObject.replyMessageObject, null, null, true, 0); + sendMessage(user, did, nullReply ? null : messageObject.replyMessageObject, null, null, true, 0); } else if ((int) did != 0) { ArrayList arrayList = new ArrayList<>(); arrayList.add(messageObject); @@ -1039,7 +1039,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe } else { entities = null; } - sendMessage(messageObject.messageOwner.message, did, messageObject.replyMessageObject, webPage, true, entities, null, null, true, 0); + sendMessage(messageObject.messageOwner.message, did, nullReply ? null : messageObject.replyMessageObject, webPage, true, entities, null, null, true, 0); } else if ((int) did != 0) { ArrayList arrayList = new ArrayList<>(); arrayList.add(messageObject); @@ -1619,7 +1619,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe } } else { for (int a = 0; a < messages.size(); a++) { - processForwardFromMyName(messages.get(a), peer); + processForwardFromMyName(messages.get(a), peer, false); } } return sendResult; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 778eb4c19..8a89a0bf8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -7132,7 +7132,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not AlertsCreator.showSendMediaAlert(getSendMessagesHelper().sendMessage(arrayList, did == 0 ? dialog_id : did, notify, scheduleDate), this); } else { for (MessageObject object : arrayList) { - getSendMessagesHelper().processForwardFromMyName(object, did == 0 ? dialog_id : did); + getSendMessagesHelper().processForwardFromMyName(object, did == 0 ? dialog_id : did, true); } } }