summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-06-12 16:05:45 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-06-12 16:05:45 +0200
commite6878ee298525ac7808595418c4b84b93788ff2e (patch)
tree5d0b397ab8836e65963e4b542163861163b91429 /src
parentMerge branch 'master' into qml-roomlist (diff)
downloadnheko-e6878ee298525ac7808595418c4b84b93788ff2e.tar.xz
Don't read avatarUrl from local profile, if no global avatar is set
Diffstat (limited to 'src')
-rw-r--r--src/Cache.cpp3
-rw-r--r--src/ui/UserProfile.cpp8
2 files changed, 5 insertions, 6 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp

index 5684de37..0d75ac51 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp
@@ -2479,7 +2479,8 @@ Cache::getMember(const std::string &room_id, const std::string &user_id) return m; } } catch (std::exception &e) { - nhlog::db()->warn("Failed to read member ({}): {}", user_id, e.what()); + nhlog::db()->warn( + "Failed to read member ({}) in room ({}): {}", user_id, room_id, e.what()); } return std::nullopt; } diff --git a/src/ui/UserProfile.cpp b/src/ui/UserProfile.cpp
index da130242..3d9c4b6a 100644 --- a/src/ui/UserProfile.cpp +++ b/src/ui/UserProfile.cpp
@@ -39,7 +39,8 @@ UserProfile::UserProfile(QString roomid, getGlobalProfileData(); } - if (!cache::client() || !cache::client()->isDatabaseReady()) + if (!cache::client() || !cache::client()->isDatabaseReady() || + !ChatPage::instance()->timelineManager()) return; connect(cache::client(), @@ -127,10 +128,7 @@ UserProfile::displayName() QString UserProfile::avatarUrl() { - return (isGlobalUserProfile() && globalAvatarUrl != "") - ? globalAvatarUrl - : cache::avatarUrl(roomid_, userid_); - ; + return isGlobalUserProfile() ? globalAvatarUrl : cache::avatarUrl(roomid_, userid_); } bool