summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_avatars.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-22 20:53:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-22 20:53:12 +0000
commit35a5290171ab6ae3c943af7c1fc21d99bae5242c (patch)
treed4c3da969dfb6a43735620c874d66173e4fa5ef3 /protocols/VKontakte/src/vk_avatars.cpp
parent15836886c666aa27d0fe5254dd356fc616c6c919 (diff)
VK: fix for async avatars loading (especially for the case of avatars in clists)
git-svn-id: http://svn.miranda-ng.org/main/trunk@6596 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_avatars.cpp')
-rw-r--r--protocols/VKontakte/src/vk_avatars.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp
index 3811ee9f64..59c9d5cbdb 100644
--- a/protocols/VKontakte/src/vk_avatars.cpp
+++ b/protocols/VKontakte/src/vk_avatars.cpp
@@ -113,3 +113,23 @@ void CVkProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen)
mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%d%s"), id, szFileType);
}
+void CVkProto::SetAvatarUrl(HANDLE hContact, LPCTSTR ptszUrl)
+{
+ ptrT oldUrl( getTStringA(hContact, "AvatarUrl"));
+ if ( !lstrcmp(ptszUrl, oldUrl))
+ return;
+
+ if (ptszUrl == NULL) {
+ delSetting(hContact, "AvatarUrl");
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, 0);
+ }
+ else {
+ setTString(hContact, "AvatarUrl", ptszUrl);
+
+ PROTO_AVATAR_INFORMATIONT AI = { sizeof(AI) };
+ AI.hContact = hContact;
+ GetAvatarFileName(AI.hContact, AI.filename, SIZEOF(AI.filename));
+ AI.format = ProtoGetAvatarFormat(AI.filename);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&AI, 0);
+ }
+}