diff options
Diffstat (limited to 'protocols/Skype/src')
-rw-r--r-- | protocols/Skype/src/skype_avatars.cpp | 16 | ||||
-rw-r--r-- | protocols/Skype/src/skype_events.cpp | 1 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.h | 5 | ||||
-rw-r--r-- | protocols/Skype/src/skype_utils.cpp | 12 |
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);
}
// ---
|