summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2014-03-26 10:12:57 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2014-03-26 10:12:57 +0000
commit5df94ab3e57398bf6ae510e14e49b726e705fae3 (patch)
tree1d853358e602fa5ef90757190cc2a00ae8cc3d77
parentb0e4435c00e362b43c494bb778bb3167eb64951f (diff)
NewsAggregator avatar fix (by Mataes)
git-svn-id: http://svn.miranda-ng.org/main/trunk@8755 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/NewsAggregator/Src/CheckFeed.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp
index e235c3d159..16dac94943 100644
--- a/plugins/NewsAggregator/Src/CheckFeed.cpp
+++ b/plugins/NewsAggregator/Src/CheckFeed.cpp
@@ -177,10 +177,12 @@ VOID CheckCurrentFeed(MCONTACT hContact)
if (!db_get_ts(hContact, MODULE, "Nick", &dbVar)) {
TCHAR *ext = _tcsrchr((TCHAR *)url, _T('.')) + 1;
- pai.format = ProtoGetAvatarFormat(ext);
+ pai.format = ProtoGetAvatarFormat(url);
TCHAR *filename = dbVar.ptszVal;
+ StrReplace(_T("/"), _T("_"), filename);
mir_sntprintf(pai.filename, SIZEOF(pai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
+ CreateDirectoryTreeT(tszRoot);
if (DownloadFile(url, pai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", pai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE) &pai, NULL);