run cargo fmt

This commit is contained in:
jikstra
2019-08-07 22:10:00 +02:00
parent 280fda24f5
commit 89c611607c

View File

@@ -1006,9 +1006,9 @@ unsafe fn create_or_lookup_group(
if !optional_field.is_null() {
X_MrRemoveFromGrp = (*optional_field).fld_value;
mime_parser.is_system_message = 5;
let left_group: libc::c_int =
(dc_lookup_contact_id_by_addr(context, X_MrRemoveFromGrp)
== from_id as libc::c_uint) as libc::c_int;
let left_group: libc::c_int = (dc_lookup_contact_id_by_addr(context, X_MrRemoveFromGrp)
== from_id as libc::c_uint)
as libc::c_int;
better_msg = context.stock_system_msg(
if 0 != left_group {
StockMessage::MsgGroupLeft
@@ -1081,12 +1081,8 @@ unsafe fn create_or_lookup_group(
}
}
set_better_msg(mime_parser, &better_msg);
chat_id = dc_get_chat_id_by_grpid(
context,
grpid,
&mut chat_id_blocked,
&mut chat_id_verified,
);
chat_id =
dc_get_chat_id_by_grpid(context, grpid, &mut chat_id_blocked, &mut chat_id_verified);
if chat_id != 0 as libc::c_uint {
if 0 != chat_id_verified
&& 0 == check_verified_properties(
@@ -1137,13 +1133,8 @@ unsafe fn create_or_lookup_group(
if 0 == allow_creation {
ok_to_continue = false;
} else {
chat_id = create_group_record(
context,
grpid,
grpname,
create_blocked,
create_verified,
);
chat_id =
create_group_record(context, grpid, grpname, create_blocked, create_verified);
chat_id_blocked = create_blocked;
recreate_member_list = 1;
}
@@ -1170,10 +1161,7 @@ unsafe fn create_or_lookup_group(
} else {
if !X_MrAddToGrp.is_null() || !X_MrRemoveFromGrp.is_null() {
recreate_member_list = 1
} else if 0 != X_MrGrpNameChanged
&& !grpname.is_null()
&& strlen(grpname) < 200
{
} else if 0 != X_MrGrpNameChanged && !grpname.is_null() && strlen(grpname) < 200 {
if sql::execute(
context,
&context.sql,
@@ -1255,11 +1243,7 @@ unsafe fn create_or_lookup_group(
from_id as u32,
))
{
dc_add_to_chat_contacts_table(
context,
chat_id,
from_id as uint32_t,
);
dc_add_to_chat_contacts_table(context, chat_id, from_id as uint32_t);
}
}
i = 0;
@@ -1277,17 +1261,12 @@ unsafe fn create_or_lookup_group(
dc_reset_gossiped_timestamp(context, chat_id);
}
if 0 != send_EVENT_CHAT_MODIFIED {
context.call_cb(
Event::CHAT_MODIFIED,
chat_id as uintptr_t,
0 as uintptr_t,
);
context.call_cb(Event::CHAT_MODIFIED, chat_id as uintptr_t, 0 as uintptr_t);
}
/* check the number of receivers -
the only critical situation is if the user hits "Reply" instead of "Reply all" in a non-messenger-client */
if to_ids_cnt == 1 && mime_parser.is_send_by_messenger == 0 {
let is_contact_cnt: libc::c_int =
dc_get_chat_contact_cnt(context, chat_id);
let is_contact_cnt: libc::c_int = dc_get_chat_contact_cnt(context, chat_id);
if is_contact_cnt > 3 {
/* to_ids_cnt==1 may be "From: A, To: B, SELF" as SELF is not counted in to_ids_cnt. So everything up to 3 is no error. */
chat_id = 0 as uint32_t;