Skip to content

Commit a7729e3

Browse files
committed
fix: move group name timestamp update up in create_send_msg_jobs()
Otherwise outdated timestamp is rendered into the message.
1 parent dc2e4df commit a7729e3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/chat.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3004,6 +3004,12 @@ async fn prepare_send_msg(
30043004
///
30053005
/// The caller has to interrupt SMTP loop or otherwise process new rows.
30063006
pub(crate) async fn create_send_msg_jobs(context: &Context, msg: &mut Message) -> Result<Vec<i64>> {
3007+
if msg.param.get_cmd() == SystemMessage::GroupNameChanged {
3008+
msg.chat_id
3009+
.update_timestamp(context, Param::GroupNameTimestamp, msg.timestamp_sort)
3010+
.await?;
3011+
}
3012+
30073013
let needs_encryption = msg.param.get_bool(Param::GuaranteeE2ee).unwrap_or_default();
30083014
let mimefactory = MimeFactory::from_msg(context, msg.clone()).await?;
30093015
let attach_selfavatar = mimefactory.attach_selfavatar;
@@ -3049,11 +3055,6 @@ pub(crate) async fn create_send_msg_jobs(context: &Context, msg: &mut Message) -
30493055
msg.state = MessageState::OutDelivered;
30503056
return Ok(Vec::new());
30513057
}
3052-
if msg.param.get_cmd() == SystemMessage::GroupNameChanged {
3053-
msg.chat_id
3054-
.update_timestamp(context, Param::GroupNameTimestamp, msg.timestamp_sort)
3055-
.await?;
3056-
}
30573058

30583059
let rendered_msg = match mimefactory.render(context).await {
30593060
Ok(res) => Ok(res),

0 commit comments

Comments
 (0)