From 91e70b1242e6e40170285bd29fdfd7c82fd45691 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 30 Mar 2019 20:52:43 +0900 Subject: User::nameForRoom(): null hint is not a hint This caused the library to erroneously believe that users with no representation in other rooms have no display name even if that display name is provided for the given room. --- lib/user.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/user.cpp b/lib/user.cpp index c373a067..951ad87d 100644 --- a/lib/user.cpp +++ b/lib/user.cpp @@ -82,7 +82,8 @@ class User::Private QString User::Private::nameForRoom(const Room* r, const QString& hint) const { // If the hint is accurate, this function is O(1) instead of O(n) - if (hint == mostUsedName || otherNames.contains(hint, r)) + if (!hint.isNull() + && (hint == mostUsedName || otherNames.contains(hint, r))) return hint; return otherNames.key(r, mostUsedName); } -- cgit v1.2.3