diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-08 13:29:55 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-08 13:29:55 +0000 |
commit | 5408daff6e544cb8e7ea5fd34531c400a7ad8bc7 (patch) | |
tree | d575a09f2a2c83115daa1c0806f46b6179f95cf7 /protocols/VKontakte | |
parent | 2df079ac06a85c5bf9f29a17cb1f57fd40f3fffe (diff) |
VK: we allow to read avatars even for the offline contacts
git-svn-id: http://svn.miranda-ng.org/main/trunk@6403 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r-- | protocols/VKontakte/src/vk_avatars.cpp | 22 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 1 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.h | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp index 6325516509..17a43318dc 100644 --- a/protocols/VKontakte/src/vk_avatars.cpp +++ b/protocols/VKontakte/src/vk_avatars.cpp @@ -37,6 +37,27 @@ void CVkProto::OnReceiveAvatar(NETLIBHTTPREQUEST *reply, void* hContact) ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
}
+INT_PTR CVkProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam)
+{
+ switch (wParam) {
+ case AF_MAXSIZE:
+ ((POINT*)lParam)->x = 100;
+ ((POINT*)lParam)->y = 100;
+ return 0;
+
+ case AF_PROPORTION:
+ return PIP_SQUARE;
+
+ case AF_FORMATSUPPORTED:
+ case AF_ENABLED:
+ case AF_DONTNEEDDELAYS:
+ case AF_FETCHALWAYS:
+ return 1;
+ }
+
+ return 0;
+}
+
INT_PTR CVkProto::SvcGetAvatarInfo(WPARAM wParam, LPARAM lParam)
{
PROTO_AVATAR_INFORMATIONT* AI = (PROTO_AVATAR_INFORMATIONT*)lParam;
@@ -97,3 +118,4 @@ void CVkProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbLen) ptrA id( getStringA(hContact, "ID"));
mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%S%s"), id, szFileType);
}
+
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 0b10090237..eebd495e3b 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -25,6 +25,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : CreateProtoService(PS_CREATEACCMGRUI, &CVkProto::SvcCreateAccMgrUI);
CreateProtoService(PS_GETAVATARINFOT, &CVkProto::SvcGetAvatarInfo);
+ CreateProtoService(PS_GETAVATARCAPS, &CVkProto::SvcGetAvatarCaps);
TCHAR descr[512];
mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName);
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 1f1db4c38b..7efe705fa8 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -86,6 +86,7 @@ struct CVkProto : public PROTO<CVkProto> INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
INT_PTR __cdecl SvcGetAvatarInfo(WPARAM, LPARAM);
+ INT_PTR __cdecl SvcGetAvatarCaps(WPARAM, LPARAM);
//==== Misc ==========================================================================
|