Private
Public Access
1
0

Workaround for empty server messages (typing indicator)

This commit is contained in:
2025-06-13 17:47:29 -07:00
parent 45d873907f
commit b2049fb432
2 changed files with 22 additions and 3 deletions

View File

@@ -250,6 +250,10 @@ impl<'a> Repository<'a> {
Ok(())
})?;
// TODO: May need to update conversation metadata here, but this has a perf impact.
// Ideally we would consolidate this in the code above, assuming we're only inserting *new* messages, but
// this may not necessarily be the case.
Ok(())
}
@@ -325,8 +329,15 @@ impl<'a> Repository<'a> {
conversation_guid,
last_message
);
conversation.date = last_message.date;
conversation.last_message_preview = Some(last_message.text.clone());
if last_message.date > conversation.date {
conversation.date = last_message.date;
}
if !last_message.text.is_empty() && !last_message.text.trim().is_empty() {
conversation.last_message_preview = Some(last_message.text.clone());
}
self.insert_conversation(conversation)?;
}
}