summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_avatars.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-01 20:40:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-01 20:40:05 +0000
commitacd4daf132c8ff3b05df7615e95f60be2fb82ddb (patch)
treeff5836cfc26ab245a356d15c90d36ece29f07189 /protocols/SkypeWeb/src/skype_avatars.cpp
parent9de7eaca48475e8e5c7f04b72451983ace0ccee5 (diff)
various quirks with PROTO_AVATAR_INFORMATION declarations
git-svn-id: http://svn.miranda-ng.org/main/trunk@13965 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_avatars.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_avatars.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/protocols/SkypeWeb/src/skype_avatars.cpp b/protocols/SkypeWeb/src/skype_avatars.cpp
index d94e1cf2c1..a058b65115 100644
--- a/protocols/SkypeWeb/src/skype_avatars.cpp
+++ b/protocols/SkypeWeb/src/skype_avatars.cpp
@@ -47,9 +47,9 @@ void CSkypeProto::ReloadAvatarInfo(MCONTACT hContact)
CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName, 0);
return;
}
- PROTO_AVATAR_INFORMATION AI = { sizeof(AI) };
- AI.hContact = hContact;
- SvcGetAvatarInfo(0, (LPARAM)&AI);
+ PROTO_AVATAR_INFORMATION ai = { 0 };
+ ai.hContact = hContact;
+ SvcGetAvatarInfo(0, (LPARAM)&ai);
}
void CSkypeProto::OnReceiveAvatar(const NETLIBHTTPREQUEST *response, void *arg)
@@ -60,21 +60,21 @@ void CSkypeProto::OnReceiveAvatar(const NETLIBHTTPREQUEST *response, void *arg)
if (response->resultCode != 200)
return;
- PROTO_AVATAR_INFORMATION AI = { sizeof(AI) };
- AI.format = ProtoGetBufferFormat(response->pData);
- setByte(hContact, "AvatarType", AI.format);
- GetAvatarFileName(hContact, AI.filename, SIZEOF(AI.filename));
+ PROTO_AVATAR_INFORMATION ai = { 0 };
+ ai.format = ProtoGetBufferFormat(response->pData);
+ setByte(hContact, "AvatarType", ai.format);
+ GetAvatarFileName(hContact, ai.filename, SIZEOF(ai.filename));
- FILE *out = _tfopen(AI.filename, _T("wb"));
+ FILE *out = _tfopen(ai.filename, _T("wb"));
if (out == NULL) {
- ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &AI, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &ai, 0);
return;
}
fwrite(response->pData, 1, response->dataLength, out);
fclose(out);
setByte(hContact, "NeedNewAvatar", 0);
- ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &ai, 0);
}
void CSkypeProto::OnSentAvatar(const NETLIBHTTPREQUEST *response)
@@ -89,23 +89,23 @@ void CSkypeProto::OnSentAvatar(const NETLIBHTTPREQUEST *response)
INT_PTR CSkypeProto::SvcGetAvatarInfo(WPARAM, LPARAM lParam)
{
- PROTO_AVATAR_INFORMATION* AI = (PROTO_AVATAR_INFORMATION*)lParam;
+ PROTO_AVATAR_INFORMATION *pai = (PROTO_AVATAR_INFORMATION*)lParam;
- ptrA szUrl(getStringA(AI->hContact, "AvatarUrl"));
+ ptrA szUrl(getStringA(pai->hContact, "AvatarUrl"));
if (szUrl == NULL)
return GAIR_NOAVATAR;
- AI->format = getByte(AI->hContact, "AvatarType", PA_FORMAT_JPEG);
+ pai->format = getByte(pai->hContact, "AvatarType", PA_FORMAT_JPEG);
TCHAR tszFileName[MAX_PATH];
- GetAvatarFileName(AI->hContact, tszFileName, SIZEOF(tszFileName));
- _tcsncpy(AI->filename, tszFileName, SIZEOF(AI->filename));
+ GetAvatarFileName(pai->hContact, tszFileName, SIZEOF(tszFileName));
+ _tcsncpy(pai->filename, tszFileName, SIZEOF(pai->filename));
- if (::_taccess(AI->filename, 0) == 0 && !getBool(AI->hContact, "NeedNewAvatar", 0))
+ if (::_taccess(pai->filename, 0) == 0 && !getBool(pai->hContact, "NeedNewAvatar", 0))
return GAIR_SUCCESS;
if (IsOnline()) {
- PushRequest(new GetAvatarRequest(szUrl), &CSkypeProto::OnReceiveAvatar, (void*)AI->hContact);
+ PushRequest(new GetAvatarRequest(szUrl), &CSkypeProto::OnReceiveAvatar, (void*)pai->hContact);
debugLogA("Requested to read an avatar from '%s'", szUrl);
return GAIR_WAITFOR;
}
@@ -152,11 +152,11 @@ void CSkypeProto::SetAvatarUrl(MCONTACT hContact, CMString &tszUrl)
else {
setTString(hContact, "AvatarUrl", tszUrl.GetBuffer());
setByte(hContact, "NeedNewAvatar", 1);
- PROTO_AVATAR_INFORMATION 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);
+ PROTO_AVATAR_INFORMATION ai = { 0 };
+ 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);
}
}