diff options
Diffstat (limited to 'external')
-rwxr-xr-x | external/messenger.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/external/messenger.py b/external/messenger.py index 9728c9d..f8f1a43 100755 --- a/external/messenger.py +++ b/external/messenger.py @@ -330,12 +330,12 @@ class MessengerBridge: def ensure_i_joined(self, thread_id): if thread_id not in self.my_joined_rooms: + self.my_joined_rooms[thread_id] = True + thread = self.client.fetchThreadInfo(thread_id)[thread_id] self.setup_joined_thread(thread) def setup_joined_thread(self, thread): - self.my_joined_rooms[thread.uid] = True - if thread.type == ThreadType.GROUP: members = self.client.fetchAllUsersFromThreads([thread]) @@ -351,6 +351,8 @@ class MessengerBridge: def send_room_info(self, thread, members): + members.sort(key=lambda m: m.uid) + room_info = {} if thread.name is not None: room_info["name"] = thread.name @@ -436,6 +438,7 @@ class MessengerBridge: author = self.getUserIdFromUid(message_object.author) event = { + "id": message_object.uid, "type": EVENT_MESSAGE, "author": author, "text": message_object.text, |