mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
cargo fmt
This commit is contained in:
16
src/chat.rs
16
src/chat.rs
@@ -1921,7 +1921,7 @@ pub fn shall_attach_selfavatar(context: &Context, chat_id: ChatId) -> Result<boo
|
|||||||
pub enum MuteDuration {
|
pub enum MuteDuration {
|
||||||
NotMuted,
|
NotMuted,
|
||||||
Forever,
|
Forever,
|
||||||
Until(i64)
|
Until(i64),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl rusqlite::types::ToSql for MuteDuration {
|
impl rusqlite::types::ToSql for MuteDuration {
|
||||||
@@ -2877,23 +2877,13 @@ mod tests {
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
// Timed in the future
|
// Timed in the future
|
||||||
set_muted(
|
set_muted(&t.ctx, chat_id, MuteDuration::Until(time() + 3600)).unwrap();
|
||||||
&t.ctx,
|
|
||||||
chat_id,
|
|
||||||
MuteDuration::Until(time() + 3600),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Chat::load_from_db(&t.ctx, chat_id).unwrap().is_muted(),
|
Chat::load_from_db(&t.ctx, chat_id).unwrap().is_muted(),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
// Time in the past
|
// Time in the past
|
||||||
set_muted(
|
set_muted(&t.ctx, chat_id, MuteDuration::Until(time() - 3600)).unwrap();
|
||||||
&t.ctx,
|
|
||||||
chat_id,
|
|
||||||
MuteDuration::Until(time() - 3600),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Chat::load_from_db(&t.ctx, chat_id).unwrap().is_muted(),
|
Chat::load_from_db(&t.ctx, chat_id).unwrap().is_muted(),
|
||||||
false
|
false
|
||||||
|
|||||||
Reference in New Issue
Block a user