mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
Simplify prepare_msg_raw() using early return
This commit will fail CI due incorrect formatting. It is done deliberately to simplify review process.
This commit is contained in:
@@ -258,7 +258,10 @@ impl<'a> Chat<'a> {
|
|||||||
|| self.typ == Chattype::VerifiedGroup)
|
|| self.typ == Chattype::VerifiedGroup)
|
||||||
{
|
{
|
||||||
error!(context, 0, "Cannot send to chat type #{}.", self.typ,);
|
error!(context, 0, "Cannot send to chat type #{}.", self.typ,);
|
||||||
} else if (self.typ == Chattype::Group || self.typ == Chattype::VerifiedGroup)
|
return Ok(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self.typ == Chattype::Group || self.typ == Chattype::VerifiedGroup)
|
||||||
&& 0 == is_contact_in_chat(context, self.id, 1 as u32)
|
&& 0 == is_contact_in_chat(context, self.id, 1 as u32)
|
||||||
{
|
{
|
||||||
log_event!(
|
log_event!(
|
||||||
@@ -267,7 +270,9 @@ impl<'a> Chat<'a> {
|
|||||||
0,
|
0,
|
||||||
"Cannot send message; self not in group.",
|
"Cannot send message; self not in group.",
|
||||||
);
|
);
|
||||||
} else {
|
return Ok(0);
|
||||||
|
}
|
||||||
|
{
|
||||||
if let Some(from) = context.sql.get_config(context, "configured_addr") {
|
if let Some(from) = context.sql.get_config(context, "configured_addr") {
|
||||||
let new_rfc724_mid = {
|
let new_rfc724_mid = {
|
||||||
let grpid = match self.typ {
|
let grpid = match self.typ {
|
||||||
|
|||||||
Reference in New Issue
Block a user