Use UPSERT when saving peerstates

This way there is no need to distinguish between creating
and updating peerstate.
This commit is contained in:
link2xt
2022-11-25 22:22:29 +00:00
parent 62f92d5b28
commit c7691fbebe
8 changed files with 43 additions and 54 deletions

View File

@@ -343,7 +343,7 @@ async fn mark_as_verified(this: &TestContext, other: &TestContext) {
peerstate.verified_key_fingerprint = peerstate.public_key_fingerprint.clone();
peerstate.to_save = true;
peerstate.save_to_db(&this.sql, false).await.unwrap();
peerstate.save_to_db(&this.sql).await.unwrap();
}
async fn get_last_info_msg(t: &TestContext, chat_id: ChatId) -> Option<Message> {