Parcourir la source

Detect DMs in get_chat_info() via RoomKind

The comparison was against the string "ROOM_KIND_DM" while _room_kinds
holds RoomKind enum members, so every chat was reported as "group".
Paul Klumpp il y a 1 semaine
Parent
commit
12136ff2e7
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      adapter.py

+ 2 - 2
adapter.py

@@ -817,8 +817,8 @@ class ChattoAdapter(BasePlatformAdapter):
         BasePlatformAdapter override
         """
         name = self._room_names.get(chat_id, chat_id)
-        kind = self._room_kinds.get(chat_id, "")
-        chat_type = "dm" if kind == "ROOM_KIND_DM" else "group"
+        kind = self._room_kinds.get(chat_id)
+        chat_type = "dm" if kind == RoomKind.DM else "group"
         return {
             "name": name,
             "type": chat_type,