Skip to content

Commit 589236c

Browse files
iequidoomissytake
authored andcommitted
fix: chat::send_msg: Remove encryption-related params from already sent message
This allows to send existing messages (incoming and outgoing) taken from encrypted chats, to unencrypted ones. `Param::ForcePlaintext` is removed as well -- if a message can be sent encrypted this time, nothing bad with this.
1 parent c16c5e0 commit 589236c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/chat.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2657,6 +2657,11 @@ pub async fn send_msg(context: &Context, chat_id: ChatId, msg: &mut Message) ->
26572657
return send_msg_inner(context, chat_id, msg).await;
26582658
}
26592659

2660+
if msg.state != MessageState::Undefined && msg.state != MessageState::OutPreparing {
2661+
msg.param.remove(Param::GuaranteeE2ee);
2662+
msg.param.remove(Param::ForcePlaintext);
2663+
msg.update_param(context).await?;
2664+
}
26602665
send_msg_inner(context, chat_id, msg).await
26612666
}
26622667

0 commit comments

Comments
 (0)