Skip to content

Commit

Permalink
refactor: create_status_update_record: Remove double check of info_ms…
Browse files Browse the repository at this point in the history
…g_id
  • Loading branch information
iequidoo committed Nov 28, 2024
1 parent 4edade2 commit 167948e
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/webxdc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 167948e

Please sign in to comment.