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