summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}