File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1010,11 +1010,11 @@ UPDATE config SET value=? WHERE keyname='configured_addr' AND value!=?1
10101010 && msg. chat_visibility == ChatVisibility :: Archived ;
10111011 updated_chats
10121012 . entry ( msg. chat_id )
1013- . and_modify ( |ts | * ts = cmp:: max ( * ts , msg. timestamp_sort ) )
1014- . or_insert ( msg. timestamp_sort ) ;
1013+ . and_modify ( |pos | * pos = cmp:: max ( * pos , ( msg. timestamp_sort , msg . id ) ) )
1014+ . or_insert ( ( msg. timestamp_sort , msg . id ) ) ;
10151015 }
10161016 }
1017- for ( chat_id, timestamp_sort) in updated_chats {
1017+ for ( chat_id, ( timestamp_sort, msg_id ) ) in updated_chats {
10181018 context
10191019 . sql
10201020 . execute (
@@ -1023,12 +1023,14 @@ UPDATE msgs SET state=? WHERE
10231023 state=? AND
10241024 hidden=0 AND
10251025 chat_id=? AND
1026- timestamp<?" ,
1026+ ( timestamp<? OR timestamp=? AND id<?) " ,
10271027 (
10281028 MessageState :: InNoticed ,
10291029 MessageState :: InFresh ,
10301030 chat_id,
10311031 timestamp_sort,
1032+ timestamp_sort,
1033+ msg_id,
10321034 ) ,
10331035 )
10341036 . await
You can’t perform that action at this time.
0 commit comments