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:
iequidoo
2025-08-09 10:03:19 -03:00
committed by iequidoo
parent f4a604dcfb
commit b4e28deed3
2 changed files with 15 additions and 0 deletions

View File

@@ -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(