diff options
author | lovetox <philipp@hoerist.com> | 2022-08-08 15:34:06 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2022-08-09 17:48:39 +0300 |
commit | 810804def4dfb87306f250029b0420f6cce90a9a (patch) | |
tree | d6c073c68eb3530f66d17f09e7ff321c4dde1cd2 | |
parent | 15121542093e7ee5b58e33dde81c18cd41f2589e (diff) |
fix: ChatControl: Fix type discovery
-rw-r--r-- | gajim/gtk/control.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/gajim/gtk/control.py b/gajim/gtk/control.py index 69284ff58..9ce562e93 100644 --- a/gajim/gtk/control.py +++ b/gajim/gtk/control.py @@ -257,24 +257,16 @@ class ChatControl(EventHelper): event.moderation.stanza_id, text) @property - def type(self) -> ControlType: - assert self._type is not None - return self._type - - @property def is_chat(self) -> bool: - assert self._type is not None - return self._type.is_chat + return isinstance(self.contact, BareContact) @property def is_privatechat(self) -> bool: - assert self._type is not None - return self._type.is_privatechat + return isinstance(self.contact, GroupchatParticipant) @property def is_groupchat(self) -> bool: - assert self._type is not None - return self._type.is_groupchat + return isinstance(self.contact, GroupchatContact) def _on_ping_event(self, event: events.PingEventT) -> None: raise NotImplementedError |