summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-04-06 09:18:45 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-04-06 09:18:45 +0000
commitb4a062fa0625cff6d7c2205508f6c0f10f8cbff7 (patch)
treefd39d55bed1b62b772ce0a9aca1b735314625be4
parent925a58a69d336f2535a1083ca05cb454e755e226 (diff)
avatar support 2nd attempt
git-svn-id: http://svn.miranda-ng.org/main/trunk@12624 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/SkypeWeb/src/skype_avatars.cpp39
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h2
3 files changed, 43 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp
index b997c92bb1..eb034906aa 100644
--- a/protocols/SkypeWeb/src/skype_avatars.cpp
+++ b/protocols/SkypeWeb/src/skype_avatars.cpp
@@ -1,5 +1,27 @@
#include "common.h"
+INT_PTR CSkypeProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam)
+{
+ switch (wParam) {
+ case AF_MAXSIZE:
+ ((POINT*)lParam)->x = 96;
+ ((POINT*)lParam)->y = 96;
+ return 0;
+
+ case AF_PROPORTION:
+ return PIP_SQUARE;
+
+ case AF_FORMATSUPPORTED:
+ case AF_ENABLED:
+ case AF_DONTNEEDDELAYS:
+ case AF_FETCHIFPROTONOTVISIBLE:
+ case AF_FETCHIFCONTACTOFFLINE:
+ return 1;
+ }
+
+ return 0;
+}
+
void CSkypeProto::ReloadAvatarInfo(MCONTACT hContact)
{
if (!hContact) {
@@ -60,6 +82,23 @@ INT_PTR CSkypeProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam)
return GAIR_NOAVATAR;
}
+INT_PTR CSkypeProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam)
+{
+ debugLogA("CSkypeProto::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 CSkypeProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen)
{
int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index d66af083a4..cf4bec1bdf 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -18,6 +18,8 @@ PROTO<CSkypeProto>(protoName, userName), password(NULL)
CreateProtoService(PS_CREATEACCMGRUI, &CSkypeProto::OnAccountManagerInit);
CreateProtoService(PS_GETAVATARINFOT, &CSkypeProto::SvcGetAvatarInfo);
+ CreateProtoService(PS_GETAVATARCAPS, &CSkypeProto::SvcGetAvatarCaps);
+ CreateProtoService(PS_GETMYAVATART, &CSkypeProto::SvcGetMyAvatar);
// custom event
DBEVENTTYPEDESCR dbEventType = { sizeof(dbEventType) };
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 39ec1acbf0..007bbfe327 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -103,6 +103,8 @@ private:
INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM);
INT_PTR __cdecl SvcGetAvatarInfo(WPARAM, LPARAM);
+ INT_PTR __cdecl SvcGetAvatarCaps(WPARAM, LPARAM);
+ INT_PTR __cdecl SvcGetMyAvatar(WPARAM, LPARAM);
// requests
void PushRequest(HttpRequest *request);