Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2022-08-08 15:34:06 +0300
committerlovetox <philipp@hoerist.com>2022-08-09 17:48:39 +0300
commit810804def4dfb87306f250029b0420f6cce90a9a (patch)
treed6c073c68eb3530f66d17f09e7ff321c4dde1cd2
parent15121542093e7ee5b58e33dde81c18cd41f2589e (diff)
fix: ChatControl: Fix type discovery
-rw-r--r--gajim/gtk/control.py14
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