mirror of
https://github.com/chatmail/core.git
synced 2026-05-24 17:26:30 +03:00
Fix one clippy::unneeded_unwrap warning
This commit is contained in:
13
src/chat.rs
13
src/chat.rs
@@ -1414,15 +1414,11 @@ pub unsafe fn add_contact_to_chat_ex(
|
||||
let contact = contact.unwrap();
|
||||
|
||||
/*this also makes sure, not contacts are added to special or normal chats*/
|
||||
let chat = Chat::load_from_db(context, chat_id);
|
||||
|
||||
if let Ok(mut chat) = Chat::load_from_db(context, chat_id) {
|
||||
if !(!real_group_exists(context, chat_id)
|
||||
|| !Contact::real_exists_by_id(context, contact_id)
|
||||
&& contact_id != DC_CONTACT_ID_SELF as u32
|
||||
|| chat.is_err())
|
||||
&& contact_id != DC_CONTACT_ID_SELF as u32)
|
||||
{
|
||||
let mut chat = chat.unwrap();
|
||||
|
||||
if !(is_contact_in_chat(context, chat_id, 1 as u32) == 1) {
|
||||
log_event!(
|
||||
context,
|
||||
@@ -1432,7 +1428,9 @@ pub unsafe fn add_contact_to_chat_ex(
|
||||
);
|
||||
} else {
|
||||
/* we should respect this - whatever we send to the group, it gets discarded anyway! */
|
||||
if 0 != flags & 0x1 && chat.param.get_int(Param::Unpromoted).unwrap_or_default() == 1 {
|
||||
if 0 != flags & 0x1
|
||||
&& chat.param.get_int(Param::Unpromoted).unwrap_or_default() == 1
|
||||
{
|
||||
chat.param.remove(Param::Unpromoted);
|
||||
chat.update_param().unwrap();
|
||||
}
|
||||
@@ -1491,6 +1489,7 @@ pub unsafe fn add_contact_to_chat_ex(
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
success
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user