mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 22:06:29 +03:00
Make needs_encryption a bool
This commit is contained in:
committed by
holger krekel
parent
a34ed5c02a
commit
697cc0a79b
@@ -631,7 +631,7 @@ pub fn job_send_msg(context: &Context, msg_id: MsgId) -> Result<(), Error> {
|
|||||||
msg.try_calc_and_set_dimensions(context).ok();
|
msg.try_calc_and_set_dimensions(context).ok();
|
||||||
|
|
||||||
/* create message */
|
/* create message */
|
||||||
let needs_encryption = msg.param.get_int(Param::GuaranteeE2ee).unwrap_or_default();
|
let needs_encryption = msg.param.get_bool(Param::GuaranteeE2ee).unwrap_or_default();
|
||||||
|
|
||||||
let attach_selfavatar = match chat::shall_attach_selfavatar(context, msg.chat_id) {
|
let attach_selfavatar = match chat::shall_attach_selfavatar(context, msg.chat_id) {
|
||||||
Ok(attach_selfavatar) => attach_selfavatar,
|
Ok(attach_selfavatar) => attach_selfavatar,
|
||||||
@@ -647,7 +647,7 @@ pub fn job_send_msg(context: &Context, msg_id: MsgId) -> Result<(), Error> {
|
|||||||
err
|
err
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
if 0 != needs_encryption && !rendered_msg.is_encrypted {
|
if needs_encryption && !rendered_msg.is_encrypted {
|
||||||
/* unrecoverable */
|
/* unrecoverable */
|
||||||
message::set_msg_failed(
|
message::set_msg_failed(
|
||||||
context,
|
context,
|
||||||
@@ -700,7 +700,7 @@ pub fn job_send_msg(context: &Context, msg_id: MsgId) -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if rendered_msg.is_encrypted && needs_encryption == 0 {
|
if rendered_msg.is_encrypted && !needs_encryption {
|
||||||
msg.param.set_int(Param::GuaranteeE2ee, 1);
|
msg.param.set_int(Param::GuaranteeE2ee, 1);
|
||||||
msg.save_param_to_disk(context);
|
msg.save_param_to_disk(context);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user