From f64a2c68e9819433a62a75691fa3a4bf3ffd4c43 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 7 Jul 2019 22:36:12 -0400 Subject: [PATCH] Fix undefined profile being requested --- src/python/matrix_client.py | 2 +- src/qml/EventHandlers/rooms.js | 1 - src/qml/Models/Users.qml | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index 94060ef1..9295e00f 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -112,7 +112,7 @@ class MatrixClient(nio.AsyncClient): async def request_user_update_event(self, user_id: str) -> None: if user_id in self.backend.pending_profile_requests: return - print(user_id) + print("Requesting profile for", user_id) self.backend.pending_profile_requests.add(user_id) response = await self.get_profile(user_id) diff --git a/src/qml/EventHandlers/rooms.js b/src/qml/EventHandlers/rooms.js index 7b02b747..c5f51e02 100644 --- a/src/qml/EventHandlers/rooms.js +++ b/src/qml/EventHandlers/rooms.js @@ -72,7 +72,6 @@ function onRoomUpdated( item ) } else { - print("re", replace, display_name) rooms.set(replace, item) } diff --git a/src/qml/Models/Users.qml b/src/qml/Models/Users.qml index ac520f4e..a392f59c 100644 --- a/src/qml/Models/Users.qml +++ b/src/qml/Models/Users.qml @@ -4,6 +4,10 @@ import "../Base" HListModel { function getUser(user_id) { + // Happens when SortFilterProxyModel ExpressionFilter/Sorter/Role tests + // the expression with invalid data to establish property bindings + if (! user_id) { return } + var found = getWhere({"userId": user_id}, 1) if (found.length > 0) { return found[0] }