diff options
author | Szymon Tokarz <wsx22@o2.pl> | 2012-10-21 22:53:31 +0000 |
---|---|---|
committer | Szymon Tokarz <wsx22@o2.pl> | 2012-10-21 22:53:31 +0000 |
commit | d14590f9a60a4ba217ba379273c9d41c1293ca82 (patch) | |
tree | 5b643f9ef723bd797935e8bfadbb408ffc156ba3 /protocols/Gadu-Gadu/src/avatar.cpp | |
parent | b5bea6ef18bd33fbb424ae9f909c119496463d02 (diff) |
Gadu-Gadu protocol
- contact's avatars requesting fix
- images transfer fix
- some fixes in TCHAR handling
should fix #5, #15 and #45
git-svn-id: http://svn.miranda-ng.org/main/trunk@2038 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/avatar.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/avatar.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index ace7871b6a..46b41361c3 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -41,7 +41,7 @@ void GGPROTO::getAvatarFilename(HANDLE hContact, TCHAR *pszDest, int cbLen) }
if (_taccess(pszDest, 0))
- CallService(MS_UTILS_CREATEDIRTREE, 0, (LPARAM)pszDest);
+ CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)pszDest);
switch (db_get_b(hContact, m_szModuleName, GG_KEY_AVATARTYPE, GG_KEYDEF_AVATARTYPE)) {
case PA_FORMAT_JPEG: avatartype = _T("jpg"); break;
@@ -52,11 +52,14 @@ void GGPROTO::getAvatarFilename(HANDLE hContact, TCHAR *pszDest, int cbLen) if (hContact != NULL) {
DBVARIANT dbv;
if (!db_get_s(hContact, m_szModuleName, GG_KEY_AVATARHASH, &dbv, DBVT_ASCIIZ)) {
- mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%s.%s"), dbv.pszVal, avatartype);
+ TCHAR* avatarHashT = mir_a2t(dbv.pszVal);
+ mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%s.%s"), avatarHashT, avatartype);
+ mir_free(avatarHashT);
DBFreeVariant(&dbv);
}
- }
- else mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%s avatar.%s"), m_szModuleName, avatartype);
+ } else {
+ mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, _T("\\%s avatar.%s"), m_tszUserName, avatartype);
+ }
}
void GGPROTO::getAvatarFileInfo(uin_t uin, char **avatarurl, int *type)
|