summaryrefslogtreecommitdiff
path: root/protocols/Skype/src
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/Skype/src
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/Skype/src')
-rw-r--r--protocols/Skype/src/skype_avatars.cpp16
-rw-r--r--protocols/Skype/src/skype_events.cpp1
-rw-r--r--protocols/Skype/src/skype_proto.h5
-rw-r--r--protocols/Skype/src/skype_utils.cpp12
4 files changed, 3 insertions, 31 deletions
diff --git a/protocols/Skype/src/skype_avatars.cpp b/protocols/Skype/src/skype_avatars.cpp
index 24c44299fc..0c3be45a88 100644
--- a/protocols/Skype/src/skype_avatars.cpp
+++ b/protocols/Skype/src/skype_avatars.cpp
@@ -23,15 +23,8 @@ bool CSkypeProto::IsAvatarChanged(const SEBinary &avatar, HANDLE hContact)
wchar_t * CSkypeProto::GetContactAvatarFilePath(HANDLE hContact)
{
- wchar_t *path = (wchar_t*)::mir_alloc(MAX_PATH * sizeof(wchar_t));
-
- this->InitCustomFolders();
-
- if (m_hAvatarsFolder == NULL || FoldersGetCustomPathT(m_hAvatarsFolder, path, MAX_PATH, _T("")))
- {
- ptrW tmpPath( ::Utils_ReplaceVarsT(L"%miranda_avatarcache%"));
- ::mir_sntprintf(path, MAX_PATH, _T("%s\\%S"), tmpPath, this->m_szModuleName);
- }
+ TCHAR path[MAX_PATH];
+ ::mir_sntprintf(path, SIZEOF(path), _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), this->m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
@@ -43,12 +36,9 @@ wchar_t * CSkypeProto::GetContactAvatarFilePath(HANDLE hContact)
else if (sid != NULL)
::mir_sntprintf(path, MAX_PATH, _T("%s\\%s avatar.jpg"), path, sid);
else
- {
- ::mir_free(path);
return NULL;
- }
- return path;
+ return mir_wstrdup(path);
}
INT_PTR __cdecl CSkypeProto::GetAvatarInfo(WPARAM, LPARAM lParam)
diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp
index a42e1ea31d..e86de2e396 100644
--- a/protocols/Skype/src/skype_events.cpp
+++ b/protocols/Skype/src/skype_events.cpp
@@ -15,7 +15,6 @@ int CSkypeProto::OnProtoModulesLoaded(WPARAM, LPARAM)
{
this->InitNetLib();
this->InitChatModule();
- this->InitCustomFolders();
this->InitInstanceHookList();
if (::ServiceExists(MS_BB_ADDBUTTON))
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h
index 2b5f7998b2..186cf34ea3 100644
--- a/protocols/Skype/src/skype_proto.h
+++ b/protocols/Skype/src/skype_proto.h
@@ -447,11 +447,6 @@ protected:
// utils
static wchar_t* ValidationReasons[];
- void InitCustomFolders();
-
- HANDLE m_hAvatarsFolder;
- bool m_bInitDone;
-
static int SkypeToMirandaLoginError(CAccount::LOGOUTREASON logoutReason);
static char *RemoveHtml(const char *data);
diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp
index 82fd39404c..27be882ada 100644
--- a/protocols/Skype/src/skype_utils.cpp
+++ b/protocols/Skype/src/skype_utils.cpp
@@ -239,18 +239,6 @@ void CSkypeProto::InitLanguages()
result[L"yo"] = L"Yoruba";
result[L"za"] = L"Zhuang";
result[L"zu"] = L"Zulu";
- }
-
-void CSkypeProto::InitCustomFolders()
-{
- if (m_bInitDone)
- return;
-
- m_bInitDone = true;
-
- TCHAR AvatarsFolder[MAX_PATH];
- ::mir_sntprintf(AvatarsFolder, SIZEOF(AvatarsFolder), _T("%%miranda_avatarcache%%\\%S"), this->m_szModuleName);
- m_hAvatarsFolder = ::FoldersRegisterCustomPathT(LPGEN("Avatars"), m_szModuleName, AvatarsFolder, m_tszUserName);
}
// ---