Don't set fake msg_id in resent messages

Setting the msg_id to `u32::MAX` is hacky, and may just as well break
things as it may fix things, because some code may use the msg.id to
load information from the database, like `get_iroh_topic_for_msg()`.

From reading the code, I couldn't find any problem with leaving the
correct `msg_id`, and if there is one, then we should add a function
parameter `is_resending` that is checked in the corresponding places.
This commit is contained in:
Hocuri
2026-04-21 16:15:21 +02:00
parent 524db830f1
commit e7d0687d90
4 changed files with 14 additions and 45 deletions

View File

@@ -6,9 +6,7 @@ use std::str::FromStr;
use std::time::Duration;
use anyhow::{bail, ensure, Result};
use deltachat::chat::{
self, Chat, ChatId, ChatItem, ChatVisibility, MessageListOptions, MuteDuration,
};
use deltachat::chat::{self, Chat, ChatId, ChatItem, ChatVisibility, MuteDuration};
use deltachat::chatlist::*;
use deltachat::constants::*;
use deltachat::contact::*;
@@ -624,7 +622,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
let msglist = chat::get_chat_msgs_ex(
&context,
sel_chat.get_id(),
MessageListOptions {
chat::MessageListOptions {
info_only: false,
add_daymarker: true,
},