mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 06:56:29 +03:00
feat: lookup_key_contact_by_address(): Allow looking up ContactId::SELF without chat id
This doesn't fix anything currently, but let's allow such lookups to avoid future bugs.
This commit is contained in:
@@ -3819,6 +3819,9 @@ async fn lookup_key_contact_by_address(
|
||||
chat_id: Option<ChatId>,
|
||||
) -> Result<Option<ContactId>> {
|
||||
if context.is_self_addr(addr).await? {
|
||||
if chat_id.is_none() {
|
||||
return Ok(Some(ContactId::SELF));
|
||||
}
|
||||
let is_self_in_chat = context
|
||||
.sql
|
||||
.exists(
|
||||
|
||||
Reference in New Issue
Block a user