From 85362d58c120a7bd121f68506fe5afad7071c29b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 3 May 2018 20:37:08 +0200 Subject: Change image directory, change emoji size --- src/Cache.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Cache.cpp') diff --git a/src/Cache.cpp b/src/Cache.cpp index fe377e8..0610a18 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -63,6 +63,13 @@ namespace dchat return dchatHomeDir; } + boost::filesystem::path Cache::getImagesDir() + { + boost::filesystem::path imagesDir = getDchatDir() / "images"; + boost::filesystem::create_directories(imagesDir); + return imagesDir; + } + void Cache::loadBindsFromFile() { StringView fileContent; @@ -157,7 +164,7 @@ namespace dchat bool failed = exitStatus != 0; if(!failed) { - boost::filesystem::path filepath = getDchatDir(); + boost::filesystem::path filepath = getImagesDir(); odhtdb::Hash urlHash(it->url.data(), it->url.size()); filepath /= urlHash.toString(); @@ -209,7 +216,7 @@ namespace dchat return it->second; // TODO: Verify hashed url is not too long for filepath on windows - boost::filesystem::path filepath = getDchatDir(); + boost::filesystem::path filepath = getImagesDir(); odhtdb::Hash urlHash(url.data(), url.size()); filepath /= urlHash.toString(); -- cgit v1.2.3