Private
Public Access
1
0

cargo fmt

This commit is contained in:
2025-06-16 19:26:13 -07:00
parent 75fe4d4608
commit 032573d23b
14 changed files with 168 additions and 113 deletions

View File

@@ -224,7 +224,7 @@ impl Daemon {
Event::UpdateStreamReconnected => {
log::info!(target: target::UPDATES, "Update stream reconnected");
// The ui client will respond differently, but we'll almost certainly want to do a sync-list in response to this.
// The ui client will respond differently, but we'll almost certainly want to do a sync-list in response to this.
self.spawn_conversation_list_sync();
// Send signal to the client that the update stream has been reconnected.
@@ -267,12 +267,14 @@ impl Daemon {
self.spawn_conversation_list_sync();
// Also restart the update monitor.
if let Err(e) = self.update_monitor_command_tx
if let Err(e) = self
.update_monitor_command_tx
.as_ref()
.unwrap()
.try_send(UpdateMonitorCommand::Restart) {
log::warn!(target: target::UPDATES, "Failed to send restart command to update monitor: {}", e);
}
.try_send(UpdateMonitorCommand::Restart)
{
log::warn!(target: target::UPDATES, "Failed to send restart command to update monitor: {}", e);
}
}
reply.send(()).unwrap();
@@ -428,7 +430,12 @@ impl Daemon {
.await
}
async fn enqueue_outgoing_message(&mut self, text: String, conversation_id: String, attachment_guids: Vec<String>) -> Uuid {
async fn enqueue_outgoing_message(
&mut self,
text: String,
conversation_id: String,
attachment_guids: Vec<String>,
) -> Uuid {
let conversation_id = conversation_id.clone();
let outgoing_message = OutgoingMessage::builder()
.text(text)
@@ -553,11 +560,12 @@ impl Daemon {
.await?;
// Filter messages that have an empty body, or a body that is just whitespace.
// This is a workaround for a bug in the server where it returns messages with an empty body, which is usually
// the typing indicator or stuff like that. In the future, we need to move to ChatItems instead of Messages.
// This is a workaround for a bug in the server where it returns messages with an empty body, which is usually
// the typing indicator or stuff like that. In the future, we need to move to ChatItems instead of Messages.
let insertable_messages: Vec<kordophone::model::Message> = messages
.into_iter()
.filter(|m| !m.text.is_empty() && !m.text.trim().is_empty()).collect();
.filter(|m| !m.text.is_empty() && !m.text.trim().is_empty())
.collect();
let db_messages: Vec<kordophone_db::models::Message> = insertable_messages
.into_iter()