File tree 1 file changed +3
-12
lines changed
1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -1080,7 +1080,8 @@ impl ChatId {
1080
1080
. unwrap_or ( 0 ) )
1081
1081
}
1082
1082
1083
- /// Returns timestamp of the latest message in the chat.
1083
+ /// Returns timestamp of the latest message in the chat,
1084
+ /// including hidden messages or a draft if there is one.
1084
1085
pub ( crate ) async fn get_timestamp ( self , context : & Context ) -> Result < Option < i64 > > {
1085
1086
let timestamp = context
1086
1087
. sql
@@ -4608,17 +4609,7 @@ pub async fn add_device_msg_with_importance(
4608
4609
// makes sure, the added message is the last one,
4609
4610
// even if the date is wrong (useful esp. when warning about bad dates)
4610
4611
let mut timestamp_sort = timestamp_sent;
4611
- if let Some ( last_msg_time) = context
4612
- . sql
4613
- . query_get_value (
4614
- "SELECT MAX(timestamp)
4615
- FROM msgs
4616
- WHERE chat_id=?
4617
- HAVING COUNT(*) > 0" ,
4618
- ( chat_id, ) ,
4619
- )
4620
- . await ?
4621
- {
4612
+ if let Some ( last_msg_time) = chat_id. get_timestamp ( context) . await ? {
4622
4613
if timestamp_sort <= last_msg_time {
4623
4614
timestamp_sort = last_msg_time + 1 ;
4624
4615
}
You can’t perform that action at this time.
0 commit comments