mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 22:36:30 +03:00
fix(jsonrpc): fix ChatListItem::is_self_in_group
Make it return the correct value for non-Group chats. This also should improve performance, thanks to the fact that we now don't have to query all the chat's contacts. Instead we only need confirm that self-contact is among the group members, and only when the chat type is `Group`.
This commit is contained in:
@@ -1494,7 +1494,7 @@ impl Chat {
|
||||
/// Checks if the user is part of a chat
|
||||
/// and has basically the permissions to edit the chat therefore.
|
||||
/// The function does not check if the chat type allows editing of concrete elements.
|
||||
pub(crate) async fn is_self_in_chat(&self, context: &Context) -> Result<bool> {
|
||||
pub async fn is_self_in_chat(&self, context: &Context) -> Result<bool> {
|
||||
match self.typ {
|
||||
Chattype::Single | Chattype::OutBroadcast | Chattype::Mailinglist => Ok(true),
|
||||
Chattype::Group => is_contact_in_chat(context, self.id, ContactId::SELF).await,
|
||||
|
||||
Reference in New Issue
Block a user