summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-11-26 06:01:58 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-11-26 06:01:58 +0000
commit24b79854af6641553a5d59a740ab0457ca658565 (patch)
tree0d7153232361aa46fc0dbe5b7f6f6a3c322dca42 /protocols/VKontakte
parent78ea011bd205b2b7f538950d32935f93debd6040 (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')
-rw-r--r--protocols/VKontakte/src/vk_avatars.cpp11
-rw-r--r--protocols/VKontakte/src/vk_proto.h2
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp2
3 files changed, 8 insertions, 7 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;
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index b20659a538..78147f7eca 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -422,7 +422,7 @@ private:
void OnLoggedOut();
void ShutdownSession();
- void SetAvatarUrl(MCONTACT hContact, LPCTSTR ptszUrl);
+ void SetAvatarUrl(MCONTACT hContact, CMString &tszUrl);
void GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen);
void ReloadAvatarInfo(MCONTACT hContact);
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 0e6e406191..c4ddcee979 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -308,7 +308,7 @@ MCONTACT CVkProto::SetContactInfo(JSONNODE* pItem, bool flag, bool self)
tszValue = json_as_string(json_get(pItem, "photo_100"));
if (!tszValue.IsEmpty()){
- SetAvatarUrl(hContact, tszValue.GetBuffer());
+ SetAvatarUrl(hContact, tszValue);
ReloadAvatarInfo(hContact);
}