summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_history.cpp
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2018-01-31 12:47:06 +0500
committerElzorFox <elzorfox@ya.ru>2018-01-31 12:47:06 +0500
commit44d61dcfa666e5d5589fb26dadefcec3421bee1d (patch)
tree902e7ea1130c74844ab9f8d28b09f8a4ddf2b36e /protocols/VKontakte/src/vk_history.cpp
parentb05eab27cf16f2316694d43211fb31827ceea727 (diff)
VKontakte:
support edited messages on history sync add edited time for edited messages update VK_API to 5.71 version bump
Diffstat (limited to 'protocols/VKontakte/src/vk_history.cpp')
-rw-r--r--protocols/VKontakte/src/vk_history.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp
index 02bde92f58..09447ea84f 100644
--- a/protocols/VKontakte/src/vk_history.cpp
+++ b/protocols/VKontakte/src/vk_history.cpp
@@ -264,13 +264,32 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque
wszBody += SetBBCString(TranslateT("Message link"), m_vkOptions.BBCForAttachments(), vkbbcUrl,
CMStringW(FORMAT, L"https://vk.com/im?sel=%d&msgid=%d", uid, mid));
- T2Utf pszBody(wszBody);
MCONTACT hContact = FindUser(uid, true);
PROTORECVEVENT recv = { 0 };
if (isRead)
recv.flags |= PREF_CREATEREAD;
if (isOut)
recv.flags |= PREF_SENT;
+
+ time_t update_time = (time_t)jnMsg["update_time"].as_int();
+ if (update_time) {
+ CMStringW wszEditTime;
+
+ wchar_t ttime[64];
+ _locale_t locale = _create_locale(LC_ALL, "");
+ _wcsftime_l(ttime, _countof(ttime), TranslateT("%x at %X"), localtime(&update_time), locale);
+ _free_locale(locale);
+
+ wszEditTime.Format(TranslateT("Edited message (updated %s):\n"), ttime);
+
+ wszBody = SetBBCString(
+ wszEditTime,
+ m_vkOptions.BBCForAttachments(), vkbbcB) +
+ wszBody;
+ }
+
+ T2Utf pszBody(wszBody);
+
recv.timestamp = datetime;
recv.szMessage = pszBody;
recv.lParam = isOut;