From 440b0540f57bb9410ee270eea4829365fbbbbf89 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 7 May 2018 06:36:49 +0200 Subject: Limit avatar size to 1mb --- README.md | 4 ++-- src/MessageBoard.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f837cee..c0eddc3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DcHaT -Decentralized chat using odhtdb. -Currently only runs on GNU/Linux. +Decentralized chat using odhtdb. Currently only runs on GNU/Linux. +Max avatar size is 1mb # Dependencies opendht, boost, libnsgif, mpv, sfml ## GNU/Linux specific diff --git a/src/MessageBoard.cpp b/src/MessageBoard.cpp index 8572873..5e101aa 100644 --- a/src/MessageBoard.cpp +++ b/src/MessageBoard.cpp @@ -126,7 +126,8 @@ namespace dchat } } - const ContentByUrlResult avatarResult = cache.getContentByUrl(message->user->avatarUrl); + // Max avatar size = 1mb + const ContentByUrlResult avatarResult = cache.getContentByUrl(message->user->avatarUrl, 1024 * 1024); if(avatarResult.type == ContentByUrlResult::Type::CACHED) { sf::Shader *circleShader = ResourceCache::getShader("shaders/circleMask.glsl", sf::Shader::Fragment); -- cgit v1.2.3