mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
bubble up update_param() error
bubble up the error instead of ignoring it - but also do not panic as before #673
This commit is contained in:
committed by
holger krekel
parent
db2064de14
commit
77cef632c7
@@ -436,7 +436,7 @@ unsafe fn add_parts(
|
|||||||
to_ids,
|
to_ids,
|
||||||
chat_id,
|
chat_id,
|
||||||
&mut chat_id_blocked,
|
&mut chat_id_blocked,
|
||||||
);
|
)?;
|
||||||
if 0 != *chat_id && Blocked::Not != chat_id_blocked && create_blocked == Blocked::Not {
|
if 0 != *chat_id && Blocked::Not != chat_id_blocked && create_blocked == Blocked::Not {
|
||||||
chat::unblock(context, *chat_id);
|
chat::unblock(context, *chat_id);
|
||||||
chat_id_blocked = Blocked::Not;
|
chat_id_blocked = Blocked::Not;
|
||||||
@@ -521,7 +521,7 @@ unsafe fn add_parts(
|
|||||||
to_ids,
|
to_ids,
|
||||||
chat_id,
|
chat_id,
|
||||||
&mut chat_id_blocked,
|
&mut chat_id_blocked,
|
||||||
);
|
)?;
|
||||||
if 0 != *chat_id && Blocked::Not != chat_id_blocked {
|
if 0 != *chat_id && Blocked::Not != chat_id_blocked {
|
||||||
chat::unblock(context, *chat_id);
|
chat::unblock(context, *chat_id);
|
||||||
chat_id_blocked = Blocked::Not;
|
chat_id_blocked = Blocked::Not;
|
||||||
@@ -968,7 +968,7 @@ unsafe fn create_or_lookup_group(
|
|||||||
to_ids: &mut Vec<u32>,
|
to_ids: &mut Vec<u32>,
|
||||||
ret_chat_id: *mut u32,
|
ret_chat_id: *mut u32,
|
||||||
ret_chat_id_blocked: &mut Blocked,
|
ret_chat_id_blocked: &mut Blocked,
|
||||||
) {
|
) -> Result<()> {
|
||||||
let group_explicitly_left: bool;
|
let group_explicitly_left: bool;
|
||||||
let mut chat_id = 0;
|
let mut chat_id = 0;
|
||||||
let mut chat_id_blocked = Blocked::Not;
|
let mut chat_id_blocked = Blocked::Not;
|
||||||
@@ -1055,7 +1055,7 @@ unsafe fn create_or_lookup_group(
|
|||||||
&mut chat_id_blocked,
|
&mut chat_id_blocked,
|
||||||
);
|
);
|
||||||
cleanup(ret_chat_id, ret_chat_id_blocked, chat_id, chat_id_blocked);
|
cleanup(ret_chat_id, ret_chat_id_blocked, chat_id, chat_id_blocked);
|
||||||
return;
|
return Ok(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1180,7 +1180,7 @@ unsafe fn create_or_lookup_group(
|
|||||||
}
|
}
|
||||||
if 0 == allow_creation {
|
if 0 == allow_creation {
|
||||||
cleanup(ret_chat_id, ret_chat_id_blocked, chat_id, chat_id_blocked);
|
cleanup(ret_chat_id, ret_chat_id_blocked, chat_id, chat_id_blocked);
|
||||||
return;
|
return Ok(());
|
||||||
}
|
}
|
||||||
chat_id = create_group_record(
|
chat_id = create_group_record(
|
||||||
context,
|
context,
|
||||||
@@ -1211,7 +1211,7 @@ unsafe fn create_or_lookup_group(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
cleanup(ret_chat_id, ret_chat_id_blocked, chat_id, chat_id_blocked);
|
cleanup(ret_chat_id, ret_chat_id_blocked, chat_id, chat_id_blocked);
|
||||||
return;
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
// execute group commands
|
// execute group commands
|
||||||
@@ -1264,7 +1264,7 @@ unsafe fn create_or_lookup_group(
|
|||||||
} else {
|
} else {
|
||||||
chat.param.set(Param::ProfileImage, grpimage);
|
chat.param.set(Param::ProfileImage, grpimage);
|
||||||
}
|
}
|
||||||
chat.update_param(context).unwrap_or_default();
|
chat.update_param(context)?;
|
||||||
send_EVENT_CHAT_MODIFIED = 1;
|
send_EVENT_CHAT_MODIFIED = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1333,6 +1333,7 @@ unsafe fn create_or_lookup_group(
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanup(ret_chat_id, ret_chat_id_blocked, chat_id, chat_id_blocked);
|
cleanup(ret_chat_id, ret_chat_id_blocked, chat_id, chat_id_blocked);
|
||||||
|
return Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Handle groups for received messages
|
/// Handle groups for received messages
|
||||||
|
|||||||
Reference in New Issue
Block a user