summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_history.cpp
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2023-11-27 14:43:31 +0500
committerElzorFox <elzorfox@ya.ru>2023-11-27 14:43:31 +0500
commit769cddb8204654c6fe2a00cfe182c464cbfb473a (patch)
treef63e6b7abd2e4d8056350085dde248c90500e04d /protocols/VKontakte/src/vk_history.cpp
parentf4339cf10662d5dc32bab34b485b7184b30befa9 (diff)
VKontakte: add hidden option ‘ShowReplyInMessage’ (default true)
Diffstat (limited to 'protocols/VKontakte/src/vk_history.cpp')
-rw-r--r--protocols/VKontakte/src/vk_history.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp
index 25275f915d..4604a99231 100644
--- a/protocols/VKontakte/src/vk_history.cpp
+++ b/protocols/VKontakte/src/vk_history.cpp
@@ -225,7 +225,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque
if (iLastMsgId < iMessageId)
iLastMsgId = iMessageId;
- char szMid[40];
+ char szMid[40], szReplyId[40] = "";;
_ltoa(iMessageId, szMid, 10);
CMStringW wszBody(jnMsg["text"].as_mstring());
@@ -245,12 +245,14 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque
}
const JSONNode& jnReplyMessages = jnMsg["reply_message"];
- if (jnReplyMessages && !jnReplyMessages.empty()) {
- CMStringW wszReplyMessages = GetFwdMessages(jnReplyMessages, jnFUsers, m_vkOptions.BBCForAttachments());
- if (!wszBody.IsEmpty())
- wszReplyMessages = L"\n" + wszReplyMessages;
- wszBody += wszReplyMessages;
- }
+ if (jnReplyMessages && !jnReplyMessages.empty())
+ if (m_vkOptions.bShowReplyInMessage) {
+ CMStringW wszReplyMessages = GetFwdMessages(jnReplyMessages, jnFUsers, m_vkOptions.BBCForAttachments());
+ if (!wszBody.IsEmpty())
+ wszReplyMessages = L"\n" + wszReplyMessages;
+ wszBody += wszReplyMessages;
+ } else if (jnReplyMessages["id"])
+ _ltoa(jnReplyMessages["id"].as_int(), szReplyId, 10);
const JSONNode &jnAttachments = jnMsg["attachments"];
if (jnAttachments && !jnAttachments.empty()) {
@@ -298,6 +300,10 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque
recv.timestamp = tDateTime;
recv.szMessage = pszBody;
recv.szMsgId = szMid;
+
+ if (!m_vkOptions.bShowReplyInMessage && szReplyId)
+ recv.szReplyId = szReplyId;
+
ProtoChainRecvMsg(hContact, &recv);
MEVENT hDbEvent = db_event_getById(m_szModuleName, strcat(szMid, "_"));