Update is_present() to take is_member into account 💪

This commit is contained in:
Veetaha 2022-11-12 01:39:59 +01:00
parent 30439d6d28
commit c65996eb75

View file

@ -266,7 +266,10 @@ impl ChatMemberKind {
/// [banned]: ChatMemberKind::Banned /// [banned]: ChatMemberKind::Banned
#[must_use] #[must_use]
pub fn is_present(&self) -> bool { pub fn is_present(&self) -> bool {
!(self.is_left() || self.is_banned()) let is_restricted_non_member =
matches!(self, Self::Restricted(Restricted { is_member: false, .. }));
!(self.is_left() || self.is_banned() || is_restricted_non_member)
} }
} }