diff options
Diffstat (limited to 'protocols/VKontakte/src/vk_avatars.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_avatars.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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);
|