mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
Propagate encryption_mode from Chat to Message
This commit is contained in:
@@ -1998,6 +1998,14 @@ pub async fn is_contact_in_chat(
|
|||||||
// the caller can get it from msg.chat_id. Forwards would need to
|
// the caller can get it from msg.chat_id. Forwards would need to
|
||||||
// be fixed for this somehow too.
|
// be fixed for this somehow too.
|
||||||
pub async fn send_msg(context: &Context, chat_id: ChatId, msg: &mut Message) -> Result<MsgId> {
|
pub async fn send_msg(context: &Context, chat_id: ChatId, msg: &mut Message) -> Result<MsgId> {
|
||||||
|
// Propagate same encryption_mode of chat to message in case messages doesn't yet have an
|
||||||
|
// encryption_mode
|
||||||
|
if let None = msg.get_encryption_modus(&context).await? {
|
||||||
|
if let Some(encryption_mode) = chat_id.get_encryption_modus(&context).await? {
|
||||||
|
msg.set_encryption_modus(&context, encryption_mode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if chat_id.is_unset() {
|
if chat_id.is_unset() {
|
||||||
let forwards = msg.param.get(Param::PrepForwards);
|
let forwards = msg.param.get(Param::PrepForwards);
|
||||||
if let Some(forwards) = forwards {
|
if let Some(forwards) = forwards {
|
||||||
|
|||||||
Reference in New Issue
Block a user