From 916fab7d4b3555a3f649d8794d9a9e13ef2c6406 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Fri, 3 Apr 2020 12:12:56 +0300 Subject: [PATCH] hide_device_expired_messages: allow missing self or device chat --- src/chat.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 23c5a7725..e89a0561e 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1620,8 +1620,12 @@ pub fn hide_device_expired_messages(context: &Context) -> Result { if let Some(delete_device_after) = context.get_config_delete_device_after() { let threshold_timestamp = time() - delete_device_after; - let self_chat_id = lookup_by_contact_id(context, DC_CONTACT_ID_SELF)?.0; - let device_chat_id = lookup_by_contact_id(context, DC_CONTACT_ID_DEVICE)?.0; + let self_chat_id = lookup_by_contact_id(context, DC_CONTACT_ID_SELF) + .unwrap_or_default() + .0; + let device_chat_id = lookup_by_contact_id(context, DC_CONTACT_ID_DEVICE) + .unwrap_or_default() + .0; // Hide expired messages //