From 167948e62a46159b8b5c961854c94b0aedec39f8 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Tue, 26 Nov 2024 23:11:31 -0300 Subject: [PATCH] refactor: create_status_update_record: Remove double check of info_msg_id --- src/webxdc.rs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/webxdc.rs b/src/webxdc.rs index f012922990..5c0b01535a 100644 --- a/src/webxdc.rs +++ b/src/webxdc.rs @@ -367,18 +367,16 @@ impl Context { .get_overwritable_info_msg_id(&instance, from_id) .await?; - if info_msg_id.is_some() && status_update_item.href.is_none() { - if let Some(info_msg_id) = info_msg_id { - chat::update_msg_text_and_timestamp( - self, - instance.chat_id, - info_msg_id, - info.as_str(), - timestamp, - ) - .await?; - notify_msg_id = info_msg_id; - } + if let (Some(info_msg_id), None) = (info_msg_id, &status_update_item.href) { + chat::update_msg_text_and_timestamp( + self, + instance.chat_id, + info_msg_id, + info.as_str(), + timestamp, + ) + .await?; + notify_msg_id = info_msg_id; } else { notify_msg_id = chat::add_info_msg_with_cmd( self,