Browse 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 1 week ago
parent
commit
8112a645b6
1 changed files with 2 additions and 2 deletions
  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,