mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
Handle errors properly
The other db-loading branches of this code handle an error, there's no reason this bit should be skipping this.
This commit is contained in:
21
src/job.rs
21
src/job.rs
@@ -682,8 +682,8 @@ impl Job {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that if there now is a chat with a contact (created by an outgoing message), then group contact requests
|
// Make sure that if there now is a chat with a contact (created by an outgoing
|
||||||
// from this contact should also be unblocked.
|
// message), then group contact requests from this contact should also be unblocked.
|
||||||
// See https://github.com/deltachat/deltachat-core-rust/issues/2097.
|
// See https://github.com/deltachat/deltachat-core-rust/issues/2097.
|
||||||
for item in chat::get_chat_msgs(context, ChatId::new(DC_CHAT_ID_DEADDROP), 0, None).await {
|
for item in chat::get_chat_msgs(context, ChatId::new(DC_CHAT_ID_DEADDROP), 0, None).await {
|
||||||
if let ChatItem::Message { msg_id } = item {
|
if let ChatItem::Message { msg_id } = item {
|
||||||
@@ -703,14 +703,15 @@ impl Job {
|
|||||||
};
|
};
|
||||||
match chat.typ {
|
match chat.typ {
|
||||||
Chattype::Group | Chattype::Mailinglist => {
|
Chattype::Group | Chattype::Mailinglist => {
|
||||||
// The next lines are actually what we do in
|
match chat::lookup_by_contact_id(context, msg.from_id).await {
|
||||||
let (_test_normal_chat_id, test_normal_chat_id_blocked) =
|
Err(e) => {
|
||||||
chat::lookup_by_contact_id(context, msg.from_id)
|
warn!(context, "can't get chat: {:#}", e);
|
||||||
.await
|
return Status::RetryLater;
|
||||||
.unwrap_or_default();
|
}
|
||||||
|
Ok((_1to1_chat, Blocked::Not)) => {
|
||||||
if test_normal_chat_id_blocked == Blocked::Not {
|
chat.id.unblock(context).await;
|
||||||
chat.id.unblock(context).await;
|
}
|
||||||
|
Ok(_) => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Chattype::Single | Chattype::Undefined => {}
|
Chattype::Single | Chattype::Undefined => {}
|
||||||
|
|||||||
Reference in New Issue
Block a user