Fix no quote forward has reply

This commit is contained in:
NekoInverter 2020-02-28 22:58:37 +08:00
parent 40e8b3adc8
commit 6b09d463a8
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9
2 changed files with 8 additions and 8 deletions

View File

@ -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<MessageObject> 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<MessageObject> 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;

View File

@ -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);
}
}
}