diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-10-03 22:35:02 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-10-03 22:35:02 +0200 |
commit | 8a21f2d4f70ecd4509aa8976c5e40ee70395a6a0 (patch) | |
tree | f6919c2533cf0e936b741b363f4facf6b1d0e2a1 /src/plugins | |
parent | df8cbfada237cb4c0467215b55ccb697cc64d568 (diff) |
Matrix: do not set avatar url for users with no avatar
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/Matrix.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 8ef7f47..d4fdd03 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -411,8 +411,8 @@ namespace QuickMedia { user_info->avatar_url = std::move(avatar_url_str); if(strncmp(user_info->avatar_url.c_str(), "mxc://", 6) == 0) user_info->avatar_url.erase(user_info->avatar_url.begin(), user_info->avatar_url.begin() + 6); - // TODO: What if the user hasn't selected an avatar? - user_info->avatar_url = homeserver + "/_matrix/media/r0/thumbnail/" + user_info->avatar_url + "?width=32&height=32&method=crop"; + if(!user_info->avatar_url.empty()) + user_info->avatar_url = homeserver + "/_matrix/media/r0/thumbnail/" + user_info->avatar_url + "?width=32&height=32&method=crop"; user_info->display_name = display_name_json.asString(); user_info->display_name_color = user_id_to_color(sender_json_str); |