summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/src/avatars.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-08 18:28:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-08 18:28:51 +0000
commita075d35ca850f06170553d17ca464f0f5feadd97 (patch)
tree5a86b9dd53d495f6ab987fe72ad2d4f06a85caa2 /protocols/AimOscar/src/avatars.cpp
parent5ba216d4b0d9a98ff6dfe0e4dd3117dcd417ce3a (diff)
separate Folders handles removed from protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@6405 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar/src/avatars.cpp')
-rw-r--r--protocols/AimOscar/src/avatars.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp
index dea8de177e..f0bd5d9480 100644
--- a/protocols/AimOscar/src/avatars.cpp
+++ b/protocols/AimOscar/src/avatars.cpp
@@ -123,31 +123,9 @@ void CAimProto::avatar_retrieval_handler(const char* sn, const char* hash, const
ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, res ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, &AI, 0);
}
-void CAimProto::init_custom_folders(void)
-{
- if (init_cst_fld_ran) return;
-
- TCHAR AvatarsFolder[MAX_PATH];
-
- mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
- hAvatarsFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), m_szModuleName, AvatarsFolder, m_tszUserName);
- init_cst_fld_ran = true;
-}
-
int CAimProto::get_avatar_filename(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext)
{
- size_t tPathLen;
- bool found = false;
-
- init_custom_folders();
-
- TCHAR* path = (TCHAR*)alloca(cbLen * sizeof(TCHAR));
- if (hAvatarsFolder == NULL || FoldersGetCustomPathT(hAvatarsFolder, path, (int)cbLen, _T("")))
- tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), (TCHAR*)VARST( _T("%miranda_avatarcache%")), m_szModuleName);
- else {
- _tcscpy(pszDest, path);
- tPathLen = _tcslen(pszDest);
- }
+ int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST( _T("%miranda_avatarcache%")), m_szModuleName);
if (ext && _taccess(pszDest, 0))
CreateDirectoryTreeT(pszDest);
@@ -159,6 +137,7 @@ int CAimProto::get_avatar_filename(HANDLE hContact, TCHAR* pszDest, size_t cbLen
tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%s"), dbv.ptszVal);
db_free(&dbv);
+ bool found = false;
if (ext == NULL)
{
mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T(".*"));