mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 06:56:29 +03:00
feat: Don't send a notification when a group member left (#6575)
When there is a broken group (which might happen with multi-transport), people want to leave it. The problem is that every "Group left" message notifies all other members and pops up the chat, so that other members also want to leave the group. This PR makes it so that "Group left" messages don't create a notification, don't cause a number-in-a-cirle badge counter on the chat, and don't sort up the chat in the chatlist. If a group is deleted, then the group won't pop up when someone leaves it; this worked fine already before this PR, and there also is a test for it.
This commit is contained in:
@@ -1048,6 +1048,14 @@ impl ChatId {
|
||||
Ok(count)
|
||||
}
|
||||
|
||||
pub(crate) async fn created_timestamp(self, context: &Context) -> Result<i64> {
|
||||
Ok(context
|
||||
.sql
|
||||
.query_get_value("SELECT created_timestamp FROM chats WHERE id=?", (self,))
|
||||
.await?
|
||||
.unwrap_or(0))
|
||||
}
|
||||
|
||||
/// Returns timestamp of the latest message in the chat.
|
||||
pub(crate) async fn get_timestamp(self, context: &Context) -> Result<Option<i64>> {
|
||||
let timestamp = context
|
||||
|
||||
Reference in New Issue
Block a user