summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src/services.cpp
diff options
context:
space:
mode:
authorSzymon Tokarz <wsx22@o2.pl>2012-11-23 01:00:25 +0000
committerSzymon Tokarz <wsx22@o2.pl>2012-11-23 01:00:25 +0000
commite1a932b1b5c6aaf73425dcf9a8312ecf6cff7d6c (patch)
tree4176819c3d595f02c2dc9ce6c7b31570f70a13e3 /protocols/Gadu-Gadu/src/services.cpp
parentf7e80ddad2316fe652eeaa5c908f8406239c6d4e (diff)
Gadu-Gadu protocol
- GG changed avatar API at http://api.gadu-gadu.pl/avatars/%d/0.xml file. Adapting our avatar code to that change. git-svn-id: http://svn.miranda-ng.org/main/trunk@2437 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/services.cpp')
-rw-r--r--protocols/Gadu-Gadu/src/services.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp
index 11c8a25ac1..ce576aa214 100644
--- a/protocols/Gadu-Gadu/src/services.cpp
+++ b/protocols/Gadu-Gadu/src/services.cpp
@@ -174,6 +174,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam)
PROTO_AVATAR_INFORMATIONT *pai = (PROTO_AVATAR_INFORMATIONT *)lParam;
char *AvatarHash = NULL, *AvatarSavedHash = NULL;
char *AvatarURL = NULL;
+ char *AvatarTs = NULL;
INT_PTR result = GAIR_NOAVATAR;
DBVARIANT dbv;
uin_t uin = (uin_t)db_get_dw(pai->hContact, m_szModuleName, GG_KEY_UIN, 0);
@@ -198,11 +199,16 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam)
AvatarURL = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
}
-
- if (AvatarURL != NULL && strlen(AvatarURL) > 0) {
+ if (!db_get_s(pai->hContact, m_szModuleName, GG_KEY_AVATARTS, &dbv, DBVT_ASCIIZ)) {
+ AvatarTs = mir_strdup(dbv.pszVal);
+ DBFreeVariant(&dbv);
+ }
+ if (AvatarURL != NULL && strlen(AvatarURL) > 0 && AvatarTs != NULL && strlen(AvatarTs) > 0) {
char *AvatarName = strrchr(AvatarURL, '/');
AvatarName++;
- AvatarHash = gg_avatarhash(AvatarName);
+ char AvatarNameWithTS[128];
+ sprintf(AvatarNameWithTS, "%s%s", AvatarName, AvatarTs);
+ AvatarHash = gg_avatarhash(AvatarNameWithTS);
}
if (!db_get_s(pai->hContact, m_szModuleName, GG_KEY_AVATARHASH, &dbv, DBVT_ASCIIZ)) {