From 2be198e70035b758e0cfbd468d551051f9b5d939 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Tue, 23 Sep 2014 10:27:30 +0000 Subject: VKontakte: support my avatar git-svn-id: http://svn.miranda-ng.org/main/trunk@10563 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_avatars.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'protocols/VKontakte/src/vk_avatars.cpp') diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp index c69fab2f32..fc6cfee1a8 100644 --- a/protocols/VKontakte/src/vk_avatars.cpp +++ b/protocols/VKontakte/src/vk_avatars.cpp @@ -62,6 +62,10 @@ INT_PTR CVkProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam) void CVkProto::ReloadAvatarInfo(MCONTACT hContact) { + if (!hContact){ + CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName, 0); + return; + } PROTO_AVATAR_INFORMATIONT AI = { sizeof(AI) }; AI.hContact = hContact; SvcGetAvatarInfo(0, (LPARAM)&AI); @@ -102,6 +106,23 @@ INT_PTR CVkProto::SvcGetAvatarInfo(WPARAM wParam, LPARAM lParam) return GAIR_NOAVATAR; } +INT_PTR CVkProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam) +{ + debugLogA("CVkProto::SvcGetMyAvatar"); + PROTO_AVATAR_INFORMATIONT AI = { sizeof(AI) }; + AI.hContact = NULL; + if (SvcGetAvatarInfo(0, (LPARAM)&AI) != GAIR_SUCCESS) + return 1; + + TCHAR* buf = (TCHAR*)wParam; + int size = (int)lParam; + + _tcsncpy(buf, AI.filename, size); + buf[size - 1] = 0; + + return 0; +} + void CVkProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen) { int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName); -- cgit v1.2.3