diff options
author | ElzorFox <elzorfox@ya.ru> | 2018-01-31 12:47:06 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2018-01-31 12:47:06 +0500 |
commit | 44d61dcfa666e5d5589fb26dadefcec3421bee1d (patch) | |
tree | 902e7ea1130c74844ab9f8d28b09f8a4ddf2b36e /protocols/VKontakte/src/vk_messages.cpp | |
parent | b05eab27cf16f2316694d43211fb31827ceea727 (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_messages.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_messages.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp index cd37e5c30c..cd3661e119 100644 --- a/protocols/VKontakte/src/vk_messages.cpp +++ b/protocols/VKontakte/src/vk_messages.cpp @@ -314,12 +314,27 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe bool bEdited = CheckMid(m_editedIds, mid);
if (bEdited) {
+ time_t update_time = (time_t)jnMsg["update_time"].as_int();
+ CMStringW wszEditTime;
+
+ if (update_time) {
+ 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.IsEmpty() ? TranslateT("Edited message:\n") : wszEditTime,
+ m_vkOptions.BBCForAttachments(), vkbbcB) +
+ wszBody;
+
CMStringW wszOldMsg;
MEVENT hDbEvent = GetMessageFromDb(hContact, szMid, datetime, wszOldMsg);
if (hDbEvent) {
- wszBody = SetBBCString(TranslateT("Edited message:\n"), m_vkOptions.BBCForAttachments(), vkbbcB) +
- wszBody +
- SetBBCString(TranslateT("\nOriginal message:\n"), m_vkOptions.BBCForAttachments(), vkbbcB) +
+ wszBody += SetBBCString(TranslateT("\nOriginal message:\n"), m_vkOptions.BBCForAttachments(), vkbbcB) +
wszOldMsg;
db_event_delete(hContact, hDbEvent);
}
|