From 5f254a929fe3ebdea26af15795e87fcbcd916647 Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 8 Aug 2025 18:36:25 +0000 Subject: [PATCH] refactor: rename icon-address-contact to icon-unencrypted The icon is mainly used to identify unencrypted chats in the chatlist where encrypted and unencrypted chats are mixed. It is used for group chats rather than only for 1:1 chats with address-contacts. --- ...con-address-contact.png => icon-unencrypted.png} | Bin ...con-address-contact.svg => icon-unencrypted.svg} | 0 src/chat.rs | 10 ++++++---- src/contact.rs | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) rename assets/{icon-address-contact.png => icon-unencrypted.png} (100%) rename assets/{icon-address-contact.svg => icon-unencrypted.svg} (100%) diff --git a/assets/icon-address-contact.png b/assets/icon-unencrypted.png similarity index 100% rename from assets/icon-address-contact.png rename to assets/icon-unencrypted.png diff --git a/assets/icon-address-contact.svg b/assets/icon-unencrypted.svg similarity index 100% rename from assets/icon-address-contact.svg rename to assets/icon-unencrypted.svg diff --git a/src/chat.rs b/src/chat.rs index d3c5ee7fb..d106d3b1e 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1784,7 +1784,7 @@ impl Chat { // This is an address-contact chat, show a special avatar that marks it as such return Ok(Some(get_abs_path( context, - Path::new(&get_address_contact_icon(context).await?), + Path::new(&get_unencrypted_icon(context).await?), ))); } else if let Some(image_rel) = self.param.get(Param::ProfileImage) { // Load the group avatar, or the device-chat / saved-messages icon @@ -2490,11 +2490,13 @@ pub(crate) async fn get_archive_icon(context: &Context) -> Result { .await } -pub(crate) async fn get_address_contact_icon(context: &Context) -> Result { +/// Returns path to the icon +/// indicating unencrypted chats and address-contacts. +pub(crate) async fn get_unencrypted_icon(context: &Context) -> Result { get_asset_icon( context, - "icon-address-contact", - include_bytes!("../assets/icon-address-contact.png"), + "icon-unencrypted", + include_bytes!("../assets/icon-unencrypted.png"), ) .await } diff --git a/src/contact.rs b/src/contact.rs index 7c902555e..cf215f101 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -1564,7 +1564,7 @@ impl Contact { return Ok(Some(chat::get_device_icon(context).await?)); } if show_fallback_icon && !self.id.is_special() && !self.is_key_contact() { - return Ok(Some(chat::get_address_contact_icon(context).await?)); + return Ok(Some(chat::get_unencrypted_icon(context).await?)); } if let Some(image_rel) = self.param.get(Param::ProfileImage) { if !image_rel.is_empty() {