summaryrefslogtreecommitdiff
path: root/protocols/AimOscar/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/AimOscar/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/AimOscar/src')
-rw-r--r--protocols/AimOscar/src/avatars.cpp25
-rw-r--r--protocols/AimOscar/src/proto.cpp1
-rw-r--r--protocols/AimOscar/src/proto.h3
3 files changed, 2 insertions, 27 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(".*"));
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index bdc2568b7b..61f1e8cdf5 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -47,7 +47,6 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) :
HookProtoEvent(ME_CLIST_GROUPCHANGE, &CAimProto::OnGroupChange);
HookProtoEvent(ME_OPT_INITIALISE, &CAimProto::OnOptionsInit);
- init_custom_folders();
offline_contacts();
TCHAR descr[MAX_PATH];
diff --git a/protocols/AimOscar/src/proto.h b/protocols/AimOscar/src/proto.h
index 9900ff937b..e7460fbe8c 100644
--- a/protocols/AimOscar/src/proto.h
+++ b/protocols/AimOscar/src/proto.h
@@ -161,13 +161,11 @@ struct CAimProto : public PROTO<CAimProto>
unsigned short mail_seqno;
//avatar connection stuff
- bool init_cst_fld_ran;
unsigned short avatar_seqno;
unsigned short avatar_id_sm;
unsigned short avatar_id_lg;
HANDLE hAvatarConn;
HANDLE hAvatarEvent;
- HANDLE hAvatarsFolder;
ft_list_type ft_list;
@@ -218,7 +216,6 @@ struct CAimProto : public PROTO<CAimProto>
void avatar_request_handler(HANDLE hContact, char* hash, unsigned char type);
void avatar_retrieval_handler(const char* sn, const char* hash, const char* data, int data_len);
int get_avatar_filename(HANDLE hContact, TCHAR* pszDest, size_t cbLen, const TCHAR *ext);
- void init_custom_folders(void);
//////////////////////////////////////////////////////////////////////////////////////
// away.cpp