diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-11-26 06:01:58 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-11-26 06:01:58 +0000 |
commit | 24b79854af6641553a5d59a740ab0457ca658565 (patch) | |
tree | 0d7153232361aa46fc0dbe5b7f6f6a3c322dca42 /protocols/VKontakte/src/vk_avatars.cpp | |
parent | 78ea011bd205b2b7f538950d32935f93debd6040 (diff) |
VKontakte: fix SetAvatarUrl
git-svn-id: http://svn.miranda-ng.org/main/trunk@11080 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_avatars.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_avatars.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp index fc3ad42f6f..c9de3f893d 100644 --- a/protocols/VKontakte/src/vk_avatars.cpp +++ b/protocols/VKontakte/src/vk_avatars.cpp @@ -145,18 +145,19 @@ void CVkProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%d%s", id, szFileType);
}
-void CVkProto::SetAvatarUrl(MCONTACT hContact, LPCTSTR ptszUrl)
+void CVkProto::SetAvatarUrl(MCONTACT hContact, CMString &tszUrl)
{
- ptrT oldUrl(getTStringA(hContact, "AvatarUrl"));
- if (!lstrcmp(ptszUrl, oldUrl))
+ CMString oldUrl(getTStringA(hContact, "AvatarUrl"));
+
+ if (tszUrl == oldUrl)
return;
- if (ptszUrl == NULL) {
+ if (tszUrl.IsEmpty()) {
delSetting(hContact, "AvatarUrl");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, 0);
}
else {
- setTString(hContact, "AvatarUrl", ptszUrl);
+ setTString(hContact, "AvatarUrl", tszUrl.GetBuffer());
setByte(hContact,"NeedNewAvatar", 1);
PROTO_AVATAR_INFORMATIONT AI = { sizeof(AI) };
AI.hContact = hContact;
|