Skip to content

Commit 796b0d7

Browse files
committed
refactor: update_msg_state: Don't avoid downgrading OutMdnRcvd to OutDelivered
`OutMdnRcvd` is a "virtual" message state now, only old messages can have this state in the db, so `update_msg_state()` can be simplified.
1 parent 2ea5c86 commit 796b0d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/message.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,8 +1826,8 @@ pub(crate) async fn update_msg_state(
18261826
context
18271827
.sql
18281828
.execute(
1829-
&format!("UPDATE msgs SET state=?1 {error_subst} WHERE id=?2 AND (?1!=?3 OR state<?3)"),
1830-
(state, msg_id, MessageState::OutDelivered),
1829+
&format!("UPDATE msgs SET state=? {error_subst} WHERE id=?"),
1830+
(state, msg_id),
18311831
)
18321832
.await?;
18331833
Ok(())

0 commit comments

Comments
 (0)