aboutsummaryrefslogtreecommitdiff
path: root/src/Cache.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-03 20:37:08 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-03 20:37:11 +0200
commit85362d58c120a7bd121f68506fe5afad7071c29b (patch)
tree96160e973ee50e07c4358079b0342f1570b6807f /src/Cache.cpp
parentc0afaebec368af694431c51fa0be1c8952b7e214 (diff)
Change image directory, change emoji size
Diffstat (limited to 'src/Cache.cpp')
-rw-r--r--src/Cache.cpp11
1 files changed, 9 insertions, 2 deletions
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();