fix: is_encrypted() should be true for Saved Messages chat

Otherwise UIs don't allow to edit messages sent to self.
This was likely broken in b417ba86bc
This commit is contained in:
link2xt
2025-11-06 14:53:57 +00:00
committed by l
parent b20da3cb0e
commit 06b038ab5d
2 changed files with 27 additions and 25 deletions

View File

@@ -1643,7 +1643,8 @@ impl Chat {
/// Returns true if the chat is encrypted. /// Returns true if the chat is encrypted.
pub async fn is_encrypted(&self, context: &Context) -> Result<bool> { pub async fn is_encrypted(&self, context: &Context) -> Result<bool> {
let is_encrypted = match self.typ { let is_encrypted = self.is_self_talk()
|| match self.typ {
Chattype::Single => { Chattype::Single => {
match context match context
.sql .sql

View File

@@ -801,6 +801,7 @@ async fn test_self_talk() -> Result<()> {
let chat = &t.get_self_chat().await; let chat = &t.get_self_chat().await;
assert!(!chat.id.is_special()); assert!(!chat.id.is_special());
assert!(chat.is_self_talk()); assert!(chat.is_self_talk());
assert!(chat.is_encrypted(&t).await?);
assert!(chat.visibility == ChatVisibility::Normal); assert!(chat.visibility == ChatVisibility::Normal);
assert!(!chat.is_device_talk()); assert!(!chat.is_device_talk());
assert!(chat.can_send(&t).await?); assert!(chat.can_send(&t).await?);