summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/VKontakte/src/version.h2
-rw-r--r--protocols/VKontakte/src/vk.h2
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp2
-rw-r--r--protocols/VKontakte/src/vk_history.cpp21
-rw-r--r--protocols/VKontakte/src/vk_messages.cpp21
5 files changed, 41 insertions, 7 deletions
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h
index 990690faf2..f0f18e9211 100644
--- a/protocols/VKontakte/src/version.h
+++ b/protocols/VKontakte/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 4
-#define __BUILD_NUM 0
+#define __BUILD_NUM 1
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h
index fcfc4aeaa3..5868e8d6fe 100644
--- a/protocols/VKontakte/src/vk.h
+++ b/protocols/VKontakte/src/vk.h
@@ -88,7 +88,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VK_USER_DEACTIVATE_ACTION 9321
-#define VK_API_VER "5.69"
+#define VK_API_VER "5.71"
#define VER_API CHAR_PARAM("v", VK_API_VER)
#define VK_FEED_USER 2147483647L
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index fec559ad87..8eb1e3ab46 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -319,7 +319,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode &
}
}
}
- else if (wszAction == L"chat_invite_user") {
+ else if (wszAction == L"chat_invite_user" || wszAction == L"chat_invite_user_by_link") {
CMStringW wszActionMid = jnMsg["action_mid"].as_mstring();
if (wszActionMid.IsEmpty())
wszBody = TranslateT("invite user");
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;
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);
}