summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_chats.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/VKontakte/src/vk_chats.cpp')
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index d58c53c801..90c38fb366 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -218,13 +218,15 @@ void CVkProto::OnReceiveChatInfo(MHttpResponse *reply, AsyncHttpRequest *pReq)
SetChatTitle(cc, jnInfo["title"].as_mstring());
- CMStringW wszValue = jnInfo["photo_100"].as_mstring();
+ CMStringW wszValue = jnInfo["photo"] ? jnInfo["photo"]["photo_100"].as_mstring() : "";
if (!wszValue.IsEmpty()) {
SetAvatarUrl(cc->m_si->hContact, wszValue);
ReloadAvatarInfo(cc->m_si->hContact);
}
- if (jnInfo["left"].as_bool() || jnInfo["kicked"].as_bool()) {
+ CMStringW wszState = jnInfo["state"].as_mstring();
+
+ if (jnInfo["left"].as_bool() || jnInfo["kicked"].as_bool() || wszState == L"left" || wszState == L"kicked") {
setByte(cc->m_si->hContact, "kicked", jnInfo["kicked"].as_bool());
LeaveChat(cc->m_iChatId);
return;