From 18170fc2601f90dd8d1b39feae78fcafeb978332 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Fri, 10 Jul 2015 12:09:55 +0000 Subject: =?UTF-8?q?VKontakte:=20add=20=E2=80=98chat=5Fphoto=5Fupdate?= =?UTF-8?q?=E2=80=99=20muc=20action=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.miranda-ng.org/main/trunk@14524 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_chats.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index fbc2bd10c5..8016f5a6f9 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -292,7 +292,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, bool bIsHistory) msgTime = now; CMString tszBody(jnMsg["body"].as_mstring()); - + const JSONNode &jnFwdMessages = jnMsg["fwd_messages"]; if (!jnFwdMessages.isnull()) { CMString tszFwdMessages = GetFwdMessages(jnFwdMessages, bbcNo); @@ -306,16 +306,14 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, bool bIsHistory) CMString tszAttachmentDescr = GetAttachmentDescr(jnAttachments, bbcNo); if (!tszBody.IsEmpty()) tszAttachmentDescr = _T("\n") + tszAttachmentDescr; - tszBody += tszAttachmentDescr; + tszBody += tszAttachmentDescr; } - if (tszBody.IsEmpty() && !jnMsg["action"].isnull()) { + if (!jnMsg["action"].isnull()) { bIsAction = true; CMString tszAction = jnMsg["action"].as_mstring(); - if (tszAction.IsEmpty()) - tszBody = _T("..."); - else if (tszAction == _T("chat_create")) { + if (tszAction == _T("chat_create")) { CMString tszActionText = jnMsg["action_text"].as_mstring(); tszBody.AppendFormat(_T("%s \"%s\""), TranslateT("create chat"), tszActionText.IsEmpty() ? _T(" ") : tszActionText); } @@ -377,6 +375,8 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, bool bIsHistory) if (!bIsHistory) SetChatTitle(cc, tszTitle); } + else if (tszAction == _T("chat_photo_update")) + tszBody.Replace(TranslateT("Attachments:"), TranslateT("changed chat cover:")); else tszBody.AppendFormat(_T(": %s (%s)"), TranslateT("chat action not supported"), tszAction); } -- cgit v1.2.3