summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/IcqOscarJ')
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.cpp27
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.h4
3 files changed, 2 insertions, 31 deletions
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp
index 07dd17fc0f..b50330a1b9 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.cpp
+++ b/protocols/IcqOscarJ/src/icq_avatar.cpp
@@ -83,20 +83,6 @@ avatars_request* CIcqProto::ReleaseAvatarRequestInQueue(avatars_request *request
}
-void CIcqProto::InitAvatars()
-{
- if (bAvatarsFolderInited)
- return;
-
- bAvatarsFolderInited = TRUE;
-
- // check if it does make sense
- TCHAR tszPath[MAX_PATH * 2];
- mir_sntprintf(tszPath, MAX_PATH * 2, _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
- hAvatarsFolder = FoldersRegisterCustomPathT(LPGEN("Avatars"), m_szModuleName, tszPath, m_tszUserName);
-}
-
-
TCHAR* CIcqProto::GetOwnAvatarFileName()
{
DBVARIANT dbvFile = {DBVT_DELETED};
@@ -123,22 +109,13 @@ void CIcqProto::GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat
void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, int cbLen)
{
TCHAR szPath[MAX_PATH * 2];
- FOLDERSGETDATA fgd = {0};
-
- InitAvatars();
+ mir_sntprintf(szPath, MAX_PATH * 2, _T("%s\\%S\\"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ FOLDERSGETDATA fgd = {0};
fgd.cbSize = sizeof(FOLDERSGETDATA);
fgd.nMaxPathSize = MAX_PATH * 2;
fgd.szPathT = szPath;
fgd.flags = FF_TCHAR;
- if (CallService(MS_FOLDERS_GET_PATH, (WPARAM)hAvatarsFolder, (LPARAM)&fgd))
- {
- TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%"));
- mir_sntprintf(szPath, MAX_PATH * 2, _T("%s\\%S\\"), tmpPath, m_szModuleName);
- mir_free(tmpPath);
- }
- else
- _tcscat(szPath, _T("\\"));
// fill the destination
lstrcpyn(pszDest, szPath, cbLen - 1);
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index 7a283eff23..42f6c95d75 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -289,8 +289,6 @@ int CIcqProto::OnModulesLoaded( WPARAM wParam, LPARAM lParam )
HookProtoEvent(ME_USERINFO_INITIALISE, &CIcqProto::OnUserInfoInit);
HookProtoEvent(ME_IDLE_CHANGED, &CIcqProto::OnIdleChanged);
- InitAvatars();
-
// Init extra optional modules
ModuleLoad(0, 0);
InitXStatusItems(FALSE);
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h
index 31f6047af3..9d392110cc 100644
--- a/protocols/IcqOscarJ/src/icq_proto.h
+++ b/protocols/IcqOscarJ/src/icq_proto.h
@@ -393,16 +393,12 @@ struct CIcqProto : public PROTO<CIcqProto>
BOOL m_avatarsConnectionPending;
avatars_server_connection *m_avatarsConnection;
- int bAvatarsFolderInited;
- HANDLE hAvatarsFolder;
-
void requestAvatarConnection();
void __cdecl AvatarThread(avatars_server_connection *pInfo);
void handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BYTE nDataLen);
void handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContact, BYTE *pHash, int nHashLen, WORD wOldStatus);
- void InitAvatars();
avatars_request *ReleaseAvatarRequestInQueue(avatars_request *request);
TCHAR* GetOwnAvatarFileName();