From 5363904a9db0162d47ab78fad04400abc7fdfe17 Mon Sep 17 00:00:00 2001 From: Hanh Date: Sun, 17 Apr 2022 11:15:59 +0800 Subject: [PATCH] Mark all as read --- src/db.rs | 2 +- src/wallet.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/db.rs b/src/db.rs index dacbf2f..2b17e01 100644 --- a/src/db.rs +++ b/src/db.rs @@ -900,7 +900,7 @@ impl DbAdapter { Ok(()) } - pub fn mark_all_message_read(&self, account: u32, read: bool) -> anyhow::Result<()> { + pub fn mark_all_messages_read(&self, account: u32, read: bool) -> anyhow::Result<()> { self.connection.execute("UPDATE messages SET read = ?1 WHERE account = ?2", params![read, account])?; Ok(()) diff --git a/src/wallet.rs b/src/wallet.rs index 09c13bb..ba6ad5f 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -539,6 +539,11 @@ impl Wallet { Ok(()) } + pub fn mark_all_messages_read(&self, account: u32, read: bool) -> anyhow::Result<()> { + self.db.mark_all_messages_read(account, read)?; + Ok(()) + } + pub fn set_lwd_url(&mut self, ld_url: &str) -> anyhow::Result<()> { self.ld_url = ld_url.to_string(); Ok(())