mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
feat: ChatId::create_for_contact_with_blocked: Don't emit events on no op
This commit is contained in:
@@ -279,9 +279,10 @@ impl ChatId {
|
|||||||
) -> Result<Self> {
|
) -> Result<Self> {
|
||||||
let chat_id = match ChatIdBlocked::lookup_by_contact(context, contact_id).await? {
|
let chat_id = match ChatIdBlocked::lookup_by_contact(context, contact_id).await? {
|
||||||
Some(chat) => {
|
Some(chat) => {
|
||||||
if create_blocked == Blocked::Not && chat.blocked != Blocked::Not {
|
if create_blocked != Blocked::Not || chat.blocked == Blocked::Not {
|
||||||
chat.id.set_blocked(context, Blocked::Not).await?;
|
return Ok(chat.id);
|
||||||
}
|
}
|
||||||
|
chat.id.set_blocked(context, Blocked::Not).await?;
|
||||||
chat.id
|
chat.id
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
|
|||||||
Reference in New Issue
Block a user