diff options
author | 2025-03-27 14:57:48 +0000 | |
---|---|---|
committer | 2025-03-27 14:57:48 +0000 | |
commit | 83a6aa0574190137b38331bd53795324139237cf (patch) | |
tree | 0cfbe858fb09325d8347b15b641a06df8d82db15 /filamento/src/logic/online.rs | |
parent | e703284539384b461d204c73e7e14daead3f06d9 (diff) | |
download | luz-83a6aa0574190137b38331bd53795324139237cf.tar.gz luz-83a6aa0574190137b38331bd53795324139237cf.tar.bz2 luz-83a6aa0574190137b38331bd53795324139237cf.zip |
feat: remove `UpdateMessage::Error` variant
Diffstat (limited to 'filamento/src/logic/online.rs')
-rw-r--r-- | filamento/src/logic/online.rs | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/filamento/src/logic/online.rs b/filamento/src/logic/online.rs index e8cbb33..967ebb2 100644 --- a/filamento/src/logic/online.rs +++ b/filamento/src/logic/online.rs @@ -75,10 +75,7 @@ pub async fn handle_online(logic: ClientLogic, command: Command, connection: Con items.into_iter().map(|item| item.into()).collect(); if let Err(e) = logic.db().replace_cached_roster(contacts.clone()).await { logic - .update_sender() - .send(UpdateMessage::Error(Error::Roster(RosterError::Cache( - e.into(), - )))) + .handle_error(Error::Roster(RosterError::Cache(e.into()))) .await; }; result_sender.send(Ok(contacts)); @@ -573,11 +570,8 @@ pub async fn handle_online(logic: ClientLogic, command: Command, connection: Con Command::SetStatus(online, sender) => { let result = logic.db().upsert_cached_status(online.clone()).await; if let Err(e) = result { - let _ = logic - .update_sender() - .send(UpdateMessage::Error(Error::SetStatus(StatusError::Cache( - e.into(), - )))) + logic + .handle_error(StatusError::Cache(e.into()).into()) .await; } let result = connection @@ -623,15 +617,10 @@ pub async fn handle_online(logic: ClientLogic, command: Command, connection: Con .db() .create_message_with_self_resource_and_chat(message.clone(), jid.clone()) .await - .map_err(|e| e.into()) { - tracing::error!("{}", e); - let _ = - logic - .update_sender() - .send(UpdateMessage::Error(Error::MessageSend( - MessageSendError::MessageHistory(e), - ))); + logic + .handle_error(MessageSendError::MessageHistory(e.into()).into()) + .await; } // TODO: don't do this, have separate from from details message.from = message.from.as_bare(); |