mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
use save API for msgs forwarded to "saved messages"
This commit is contained in:
parent
d47196d899
commit
ec7807e662
1 changed files with 17 additions and 2 deletions
|
@ -38,9 +38,24 @@ public class SendRelayedMessageUtil {
|
||||||
if (isForwarding(activity)) {
|
if (isForwarding(activity)) {
|
||||||
int[] forwardedMessageIDs = getForwardedMessageIDs(activity);
|
int[] forwardedMessageIDs = getForwardedMessageIDs(activity);
|
||||||
resetRelayingMessageContent(activity);
|
resetRelayingMessageContent(activity);
|
||||||
|
if (forwardedMessageIDs == null) return;
|
||||||
|
|
||||||
Util.runOnAnyBackgroundThread(() -> {
|
Util.runOnAnyBackgroundThread(() -> {
|
||||||
for (long chatId : chatIds) {
|
DcContext dcContext = DcHelper.getContext(activity);
|
||||||
handleForwarding(activity, (int) chatId, forwardedMessageIDs);
|
for (long longChatId : chatIds) {
|
||||||
|
int chatId = (int) longChatId;
|
||||||
|
if (dcContext.getChat(chatId).isSelfTalk()) {
|
||||||
|
for (int msgId : forwardedMessageIDs) {
|
||||||
|
DcMsg msg = dcContext.getMsg(msgId);
|
||||||
|
if (msg.canSave() && msg.getSavedMsgId() == 0 && msg.getChatId() != chatId) {
|
||||||
|
dcContext.saveMsgs(new int[]{msgId});
|
||||||
|
} else {
|
||||||
|
handleForwarding(activity, chatId, new int[]{msgId});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handleForwarding(activity, chatId, forwardedMessageIDs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue