mirror of
https://github.com/chatmail/core.git
synced 2026-04-06 15:42:10 +03:00
Add get_gossiped_timestamp
This commit is contained in:
committed by
holger krekel
parent
789fc0a7e0
commit
9d201eb9c6
13
src/chat.rs
13
src/chat.rs
@@ -1567,6 +1567,19 @@ pub fn reset_gossiped_timestamp(context: &Context, chat_id: u32) -> crate::sql::
|
||||
set_gossiped_timestamp(context, chat_id, 0)
|
||||
}
|
||||
|
||||
/// Get timestamp of the last gossip sent in the chat.
|
||||
/// Zero return value means that gossip was never sent.
|
||||
pub fn get_gossiped_timestamp(context: &Context, chat_id: u32) -> i64 {
|
||||
context
|
||||
.sql
|
||||
.query_get_value::<_, i64>(
|
||||
context,
|
||||
"SELECT gossiped_timestamp FROM chats WHERE chat_id=?;",
|
||||
params![chat_id as i32],
|
||||
)
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn set_gossiped_timestamp(
|
||||
context: &Context,
|
||||
chat_id: u32,
|
||||
|
||||
Reference in New Issue
Block a user