summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-03 17:14:30 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-03 17:14:30 +0300
commit1338ad89ee45bdb681c531476dca00a377d7d033 (patch)
tree3eae8ad7620848a1a8b12ced532d826aae81a224
parent8a0d55713496fe7c8eecc0267d775b1bb29e0842 (diff)
PROTO_INTERFACE::SendMsg: second parameter became a reply event id
-rw-r--r--include/m_protoint.h2
-rw-r--r--libs/win32/mir_app.libbin274492 -> 274496 bytes
-rw-r--r--libs/win64/mir_app.libbin273756 -> 273760 bytes
-rw-r--r--protocols/Discord/src/proto.cpp2
-rw-r--r--protocols/Discord/src/proto.h2
-rw-r--r--protocols/Dummy/src/dummy_proto.cpp2
-rw-r--r--protocols/Dummy/src/dummy_proto.h2
-rw-r--r--protocols/Facebook/src/groupchats.cpp2
-rw-r--r--protocols/Facebook/src/proto.cpp2
-rw-r--r--protocols/Facebook/src/proto.h2
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.h2
-rw-r--r--protocols/ICQ-WIM/src/groupchats.cpp2
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp2
-rw-r--r--protocols/ICQ-WIM/src/proto.h2
-rw-r--r--protocols/IRCG/src/ircproto.cpp2
-rw-r--r--protocols/IRCG/src/ircproto.h2
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp2
-rw-r--r--protocols/JabberG/src/jabber_omemo.cpp2
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp2
-rw-r--r--protocols/JabberG/src/jabber_proto.h2
-rw-r--r--protocols/Sametime/src/sametime_proto.cpp2
-rw-r--r--protocols/Sametime/src/sametime_proto.h2
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h2
-rw-r--r--protocols/Steam/src/steam_proto.cpp2
-rw-r--r--protocols/Steam/src/steam_proto.h2
-rw-r--r--protocols/Telegram/src/groupchat.cpp2
-rw-r--r--protocols/Telegram/src/proto.cpp11
-rw-r--r--protocols/Telegram/src/proto.h4
-rw-r--r--protocols/Telegram/src/server.cpp3
-rw-r--r--protocols/Tox/src/tox_proto.cpp2
-rw-r--r--protocols/Tox/src/tox_proto.h2
-rw-r--r--protocols/Twitter/src/proto.cpp2
-rw-r--r--protocols/Twitter/src/proto.h2
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp2
-rw-r--r--protocols/VKontakte/src/vk_messages.cpp4
-rw-r--r--protocols/VKontakte/src/vk_proto.h2
-rw-r--r--protocols/WhatsApp/src/proto.cpp2
-rw-r--r--protocols/WhatsApp/src/proto.h2
-rw-r--r--src/mir_app/src/mir_app.def2
-rw-r--r--src/mir_app/src/mir_app64.def2
-rw-r--r--src/mir_app/src/proto_interface.cpp2
-rw-r--r--src/mir_app/src/proto_internal.cpp4
-rw-r--r--src/mir_app/src/protocols.cpp2
45 files changed, 55 insertions, 47 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 283a830c2c..5351bcb921 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -240,7 +240,7 @@ public:
virtual int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
virtual HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
- virtual int SendMsg(MCONTACT hContact, const char *msg);
+ virtual int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *msg);
virtual int SetApparentMode(MCONTACT hContact, int mode);
virtual int SetStatus(int iNewStatus);
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index c32b73bb0c..487c790aeb 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index 4daf508061..22c12ae2f2 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index b9c13939e3..423242c338 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -480,7 +480,7 @@ void CDiscordProto::OnSendMsg(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pReq)
}
}
-int CDiscordProto::SendMsg(MCONTACT hContact, const char *pszSrc)
+int CDiscordProto::SendMsg(MCONTACT hContact, MEVENT, const char *pszSrc)
{
if (!m_bOnline)
return -1;
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h
index 89523eeb37..6e62cb0d5a 100644
--- a/protocols/Discord/src/proto.h
+++ b/protocols/Discord/src/proto.h
@@ -368,7 +368,7 @@ public:
HANDLE GetAwayMsg(MCONTACT hContact) override;
int SetAwayMsg(int iStatus, const wchar_t *msg) override;
- int SendMsg(MCONTACT hContact, const char *pszSrc) override;
+ int SendMsg(MCONTACT hContact, MEVENT, const char *pszSrc) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp
index a3f0eb113e..e89442144b 100644
--- a/protocols/Dummy/src/dummy_proto.cpp
+++ b/protocols/Dummy/src/dummy_proto.cpp
@@ -136,7 +136,7 @@ INT_PTR CDummyProto::GetCaps(int type, MCONTACT)
//////////////////////////////////////////////////////////////////////////////
-int CDummyProto::SendMsg(MCONTACT hContact, const char *msg)
+int CDummyProto::SendMsg(MCONTACT hContact, MEVENT, const char *msg)
{
std::string message = msg;
unsigned int id = InterlockedIncrement(&this->msgid);
diff --git a/protocols/Dummy/src/dummy_proto.h b/protocols/Dummy/src/dummy_proto.h
index 3760fbba4a..2aeb34705f 100644
--- a/protocols/Dummy/src/dummy_proto.h
+++ b/protocols/Dummy/src/dummy_proto.h
@@ -30,7 +30,7 @@ struct CDummyProto : public PROTO<CDummyProto>
INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
- int SendMsg(MCONTACT hContact, const char* msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT, const char* msg) override;
int SetStatus(int iNewStatus) override;
diff --git a/protocols/Facebook/src/groupchats.cpp b/protocols/Facebook/src/groupchats.cpp
index 9215983585..3717d65eef 100644
--- a/protocols/Facebook/src/groupchats.cpp
+++ b/protocols/Facebook/src/groupchats.cpp
@@ -164,7 +164,7 @@ int FacebookProto::GroupchatEventHook(WPARAM, LPARAM lParam)
wchar_t *wszText = NEWWSTR_ALLOCA(gch->ptszText);
Chat_UnescapeTags(wszText);
- int mid = SendMsg(si->hContact, T2Utf(wszText));
+ int mid = SendMsg(si->hContact, 0, T2Utf(wszText));
mir_cslock lck(m_csOwnMessages);
for (auto &msg : arOwnMessages)
diff --git a/protocols/Facebook/src/proto.cpp b/protocols/Facebook/src/proto.cpp
index 30f0d7163f..bec6bac475 100644
--- a/protocols/Facebook/src/proto.cpp
+++ b/protocols/Facebook/src/proto.cpp
@@ -213,7 +213,7 @@ INT_PTR FacebookProto::GetCaps(int type, MCONTACT)
/////////////////////////////////////////////////////////////////////////////////////////
-int FacebookProto::SendMsg(MCONTACT hContact, const char *pszSrc)
+int FacebookProto::SendMsg(MCONTACT hContact, MEVENT, const char *pszSrc)
{
if (!m_bOnline)
return -1;
diff --git a/protocols/Facebook/src/proto.h b/protocols/Facebook/src/proto.h
index 660146e56f..e8ea77d658 100644
--- a/protocols/Facebook/src/proto.h
+++ b/protocols/Facebook/src/proto.h
@@ -528,7 +528,7 @@ public:
MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
INT_PTR GetCaps(int type, MCONTACT hContact) override;
- int SendMsg(MCONTACT hContact, const char *pszSrc) override;
+ int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *pszSrc) override;
int SetStatus(int iNewStatus) override;
int UserIsTyping(MCONTACT hContact, int type) override;
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 82c53a6a94..856ce81228 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -506,7 +506,7 @@ HWND GaduProto::CreateExtendedSearchUI(HWND owner)
//////////////////////////////////////////////////////////
// when messsage sent
//
-int GaduProto::SendMsg(MCONTACT hContact, const char *msg)
+int GaduProto::SendMsg(MCONTACT hContact, MEVENT, const char *msg)
{
uin_t uin = (uin_t)getDword(hContact, GG_KEY_UIN, 0);
if (!isonline())
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h
index a5bf2f7a59..5e840893d0 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.h
+++ b/protocols/Gadu-Gadu/src/gg_proto.h
@@ -46,7 +46,7 @@ struct GaduProto : public PROTO<GaduProto>
HWND CreateExtendedSearchUI(HWND owner) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles) override;
- int SendMsg(MCONTACT hContact, const char* msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char* msg) override;
int SetApparentMode(MCONTACT hContact, int mode) override;
int SetStatus(int iNewStatus) override;
diff --git a/protocols/ICQ-WIM/src/groupchats.cpp b/protocols/ICQ-WIM/src/groupchats.cpp
index abeaa9a503..59e9fb68a4 100644
--- a/protocols/ICQ-WIM/src/groupchats.cpp
+++ b/protocols/ICQ-WIM/src/groupchats.cpp
@@ -253,7 +253,7 @@ int CIcqProto::GroupchatEventHook(WPARAM, LPARAM lParam)
if (m_bOnline) {
wchar_t *wszText = NEWWSTR_ALLOCA(gch->ptszText);
Chat_UnescapeTags(wszText);
- SendMsg(si->hContact, T2Utf(wszText));
+ SendMsg(si->hContact, 0, T2Utf(wszText));
}
break;
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 915dbd0832..ef67bb68e0 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -538,7 +538,7 @@ HANDLE CIcqProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, wcha
////////////////////////////////////////////////////////////////////////////////////////
// PS_SendMessage - sends a message
-int CIcqProto::SendMsg(MCONTACT hContact, const char *pszSrc)
+int CIcqProto::SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *pszSrc)
{
CMStringA szUserid(GetUserId(hContact));
if (szUserid.IsEmpty())
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h
index 0919c3dad0..582fc4d8de 100644
--- a/protocols/ICQ-WIM/src/proto.h
+++ b/protocols/ICQ-WIM/src/proto.h
@@ -410,7 +410,7 @@ class CIcqProto : public PROTO<CIcqProto>
HANDLE SearchBasic(const wchar_t *id) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
- int SendMsg(MCONTACT hContact, const char *msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *msg) override;
int SetApparentMode(MCONTACT hContact, int mode) override;
int SetStatus(int iNewStatus) override;
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index c4ecb1e30e..08ff522165 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -581,7 +581,7 @@ HANDLE CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** ppszFile
////////////////////////////////////////////////////////////////////////////////////////
// SendMessage - sends a message
-int CIrcProto::SendMsg(MCONTACT hContact, const char* pszSrc)
+int CIrcProto::SendMsg(MCONTACT hContact, MEVENT, const char* pszSrc)
{
uint8_t bDcc = getByte(hContact, "DCC", 0);
uint16_t wStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE);
diff --git a/protocols/IRCG/src/ircproto.h b/protocols/IRCG/src/ircproto.h
index 6b30cea36d..4945ac4277 100644
--- a/protocols/IRCG/src/ircproto.h
+++ b/protocols/IRCG/src/ircproto.h
@@ -62,7 +62,7 @@ struct CIrcProto : public PROTO<CIrcProto>
HANDLE SearchBasic(const wchar_t* id) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
- int SendMsg(MCONTACT hContact, const char* msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT, const char* msg) override;
int SetStatus(int iNewStatus) override;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index e54817fe25..6906c24c2b 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -1348,7 +1348,7 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam)
if (gch->ptszText && mir_wstrlen(gch->ptszText) > 0) {
rtrimw(gch->ptszText);
Chat_UnescapeTags(gch->ptszText);
- SendMsg(item->hContact, T2Utf(gch->ptszText));
+ SendMsg(item->hContact, 0, T2Utf(gch->ptszText));
}
break;
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp
index 6e0b7a172c..d1f921f9b4 100644
--- a/protocols/JabberG/src/jabber_omemo.cpp
+++ b/protocols/JabberG/src/jabber_omemo.cpp
@@ -1206,7 +1206,7 @@ void CJabberProto::OmemoPutMessageToOutgoingQueue(MCONTACT hContact, const char*
void CJabberProto::OmemoHandleMessageQueue()
{
for (auto &i : m_omemo.outgoing_messages) {
- SendMsg(i.hContact, i.pszSrc);
+ SendMsg(i.hContact, 0, i.pszSrc);
mir_free(i.pszSrc);
}
m_omemo.outgoing_messages.clear();
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 03a1ce8aa3..8b6363b67a 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -883,7 +883,7 @@ HANDLE CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, w
////////////////////////////////////////////////////////////////////////////////////////
// SendMessage - sends a message
-int CJabberProto::SendMsg(MCONTACT hContact, const char *pszSrc)
+int CJabberProto::SendMsg(MCONTACT hContact, MEVENT, const char *pszSrc)
{
XmlNode m("message");
return SendMsgEx(hContact, pszSrc, m);
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index c85a2bb988..9078d37f0e 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -138,7 +138,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
- int SendMsg(MCONTACT hContact, const char *msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT, const char *msg) override;
int SendMsgEx(MCONTACT hContact, const char *msg, XmlNode &m);
int SetApparentMode(MCONTACT hContact, int mode) override;
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp
index 89774f0b63..b9e3c61d9c 100644
--- a/protocols/Sametime/src/sametime_proto.cpp
+++ b/protocols/Sametime/src/sametime_proto.cpp
@@ -195,7 +195,7 @@ HANDLE CSametimeProto::SendFile(MCONTACT hContact, const wchar_t* szDescription,
return nullptr; // failure
}
-int CSametimeProto::SendMsg(MCONTACT hContact, const char* msg)
+int CSametimeProto::SendMsg(MCONTACT hContact, MEVENT, const char* msg)
{
debugLogW(L"CSametimeProto::SendMsg() hContact=[%x]", hContact);
diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h
index e2faca6d07..53251ff531 100644
--- a/protocols/Sametime/src/sametime_proto.h
+++ b/protocols/Sametime/src/sametime_proto.h
@@ -28,7 +28,7 @@ struct CSametimeProto : public PROTO<CSametimeProto>
MEVENT RecvMsg(MCONTACT hContact, PROTORECVEVENT*) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles) override;
- int SendMsg(MCONTACT hContact, const char* msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT, const char* msg) override;
int SetStatus(int iNewStatus) override;
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index aab76d7ad8..16d9b2cb03 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* MESSAGE SENDING */
// outcoming message flow
-int CSkypeProto::SendMsg(MCONTACT hContact, const char *szMessage)
+int CSkypeProto::SendMsg(MCONTACT hContact, MEVENT, const char *szMessage)
{
if (!IsOnline())
return -1;
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index b87b5b7a77..d822c123f7 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -59,7 +59,7 @@ public:
INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
int GetInfo(MCONTACT hContact, int infoType) override;
HANDLE SearchBasic(const wchar_t* id) override;
- int SendMsg(MCONTACT hContact, const char* msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char* msg) override;
int SetStatus(int iNewStatus) override;
int UserIsTyping(MCONTACT hContact, int type) override;
int RecvContacts(MCONTACT hContact, PROTORECVEVENT*) override;
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index 38643c2f47..2e2eb6faff 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -243,7 +243,7 @@ HANDLE CSteamProto::SearchByName(const wchar_t *nick, const wchar_t *firstName,
return (HANDLE)STEAM_SEARCH_BYNAME;
}
-int CSteamProto::SendMsg(MCONTACT hContact, const char *message)
+int CSteamProto::SendMsg(MCONTACT hContact, MEVENT, const char *message)
{
if (!IsOnline())
return -1;
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h
index cdc4e3f6ff..4e6acdfef7 100644
--- a/protocols/Steam/src/steam_proto.h
+++ b/protocols/Steam/src/steam_proto.h
@@ -278,7 +278,7 @@ public:
HANDLE SearchBasic(const wchar_t *id) override;
HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override;
- int SendMsg(MCONTACT hContact, const char *msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *msg) override;
int SetStatus(int iNewStatus) override;
diff --git a/protocols/Telegram/src/groupchat.cpp b/protocols/Telegram/src/groupchat.cpp
index 618f415922..c99302d435 100644
--- a/protocols/Telegram/src/groupchat.cpp
+++ b/protocols/Telegram/src/groupchat.cpp
@@ -205,7 +205,7 @@ int CTelegramProto::GcEventHook(WPARAM, LPARAM lParam)
rtrimw(gch->ptszText);
Chat_UnescapeTags(gch->ptszText);
if (auto *pUser = FindUser(userId))
- SendTextMessage(pUser->chatId, T2Utf(gch->ptszText));
+ SendTextMessage(pUser->chatId, 0, T2Utf(gch->ptszText));
}
break;
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index 3f5037e65f..be2156be82 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -597,7 +597,7 @@ HANDLE CTelegramProto::SendFile(MCONTACT hContact, const wchar_t *szDescription,
/////////////////////////////////////////////////////////////////////////////////////////
-int CTelegramProto::SendMsg(MCONTACT hContact, const char *pszMessage)
+int CTelegramProto::SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *pszMessage)
{
ptrA szId(getStringA(hContact, DBKEY_ID));
if (szId == nullptr)
@@ -608,7 +608,14 @@ int CTelegramProto::SendMsg(MCONTACT hContact, const char *pszMessage)
if (pUser == nullptr)
return 0;
- int msgid = SendTextMessage(pUser->chatId, pszMessage);
+ TD::int53 iReplyId = 0;
+ if (hReplyEvent) {
+ DB::EventInfo dbei(hReplyEvent, false);
+ if (dbei)
+ iReplyId = dbei2id(dbei);
+ }
+
+ int msgid = SendTextMessage(pUser->chatId, iReplyId, pszMessage);
if (msgid != -1)
m_arOwnMsg.insert(new TG_OWN_MESSAGE(hContact, (HANDLE)msgid, ""));
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h
index db995e49be..45839832a5 100644
--- a/protocols/Telegram/src/proto.h
+++ b/protocols/Telegram/src/proto.h
@@ -241,7 +241,7 @@ class CTelegramProto : public PROTO<CTelegramProto>
void SendMarkRead(void);
int SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER pHandler = nullptr);
int SendQuery(TD::Function *pFunc, TG_QUERY_HANDLER_FULL pHandler, void *pUserInfo);
- int SendTextMessage(int64_t chatId, const char *pszMessage);
+ int SendTextMessage(TD::int53 chatId, TD::int53 replyId, const char *pszMessage);
void ProcessAuth(TD::updateAuthorizationState *pObj);
void ProcessBasicGroup(TD::updateBasicGroup *pObj);
@@ -356,7 +356,7 @@ public:
MEVENT RecvFile(MCONTACT hContact, PROTORECVFILE *pre) override;
HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override;
- int SendMsg(MCONTACT hContact, const char *pszMessage) override;
+ int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *pszMessage) override;
int SetStatus(int iNewStatus) override;
void OnBuildProtoMenu() override;
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index bb92d2af7d..75e4fa0cdc 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -327,7 +327,7 @@ void CTelegramProto::OnSendMessage(td::ClientManager::Response &response)
}
}
-int CTelegramProto::SendTextMessage(int64_t chatId, const char *pszMessage)
+int CTelegramProto::SendTextMessage(int64_t chatId, TD::int53 replyId, const char *pszMessage)
{
auto pContent = TD::make_object<TD::inputMessageText>();
pContent->text_ = formatBbcodes(pszMessage);
@@ -335,6 +335,7 @@ int CTelegramProto::SendTextMessage(int64_t chatId, const char *pszMessage)
auto *pMessage = new TD::sendMessage();
pMessage->chat_id_ = chatId;
pMessage->input_message_content_ = std::move(pContent);
+ pMessage->reply_to_message_id_ = replyId;
return SendQuery(pMessage, &CTelegramProto::OnSendMessage);
}
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp
index cfabeefac9..d701171a0f 100644
--- a/protocols/Tox/src/tox_proto.cpp
+++ b/protocols/Tox/src/tox_proto.cpp
@@ -139,7 +139,7 @@ HWND CToxProto::CreateExtendedSearchUI(HWND owner)
return OnCreateExtendedSearchUI(owner);
}
-int CToxProto::SendMsg(MCONTACT hContact, const char *msg)
+int CToxProto::SendMsg(MCONTACT hContact, MEVENT, const char *msg)
{
return OnSendMessage(hContact, msg);
}
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h
index f69c695874..5277caa0ba 100644
--- a/protocols/Tox/src/tox_proto.h
+++ b/protocols/Tox/src/tox_proto.h
@@ -55,7 +55,7 @@ public:
HANDLE SearchAdvanced(HWND owner) override;
HWND CreateExtendedSearchUI(HWND owner) override;
- int SendMsg(MCONTACT hContact, const char *msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT, const char *msg) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t *, wchar_t **ppszFiles) override;
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp
index b28506cec1..4b6b969652 100644
--- a/protocols/Twitter/src/proto.cpp
+++ b/protocols/Twitter/src/proto.cpp
@@ -120,7 +120,7 @@ INT_PTR CTwitterProto::GetCaps(int type, MCONTACT)
/////////////////////////////////////////////////////////////////////////////////////////
-int CTwitterProto::SendMsg(MCONTACT hContact, const char *msg)
+int CTwitterProto::SendMsg(MCONTACT hContact, MEVENT, const char *msg)
{
if (m_iStatus != ID_STATUS_ONLINE)
return -1;
diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h
index 1e3e408830..d75753d0b2 100644
--- a/protocols/Twitter/src/proto.h
+++ b/protocols/Twitter/src/proto.h
@@ -177,7 +177,7 @@ public:
HANDLE SearchBasic(const wchar_t *) override;
HANDLE SearchByEmail(const wchar_t *) override;
- int SendMsg(MCONTACT, const char *) override;
+ int SendMsg(MCONTACT, MEVENT, const char *) override;
int SetStatus(int) override;
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 5e6f208b76..695fccb737 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -611,7 +611,7 @@ int CVkProto::OnChatEvent(WPARAM, LPARAM lParam)
ptrW pwszBuf(mir_wstrdup(gch->ptszText));
rtrimw(pwszBuf);
Chat_UnescapeTags(pwszBuf);
- SendMsg(cc->m_si->hContact, T2Utf(pwszBuf));
+ SendMsg(cc->m_si->hContact, 0, T2Utf(pwszBuf));
}
break;
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp
index 9cdf21f0f8..23b332be39 100644
--- a/protocols/VKontakte/src/vk_messages.cpp
+++ b/protocols/VKontakte/src/vk_messages.cpp
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//////////////////////////////////////////////////////////////////////////////
-int CVkProto::SendMsg(MCONTACT hContact, const char *szMsg)
+int CVkProto::SendMsg(MCONTACT hContact, MEVENT, const char *szMsg)
{
debugLogA("CVkProto::SendMsg");
if (!IsOnline())
@@ -64,7 +64,7 @@ int CVkProto::SendMsg(MCONTACT hContact, const char *szMsg)
ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)uMsgId);
if (!IsEmpty(pszRetMsg))
- SendMsg(hContact, pszRetMsg);
+ SendMsg(hContact, 0, pszRetMsg);
else if (m_iStatus == ID_STATUS_INVISIBLE)
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.setOffline.json", true, &CVkProto::OnReceiveSmth));
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index 1c6e747e2a..74f164838b 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -66,7 +66,7 @@ struct CVkProto : public PROTO<CVkProto>
HANDLE SearchBasic(const wchar_t *id) override;
HANDLE SearchByEmail(const wchar_t *email) override;
HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override;
- int SendMsg(MCONTACT hContact, const char *msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT, const char *msg) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
int SetStatus(int iNewStatus) override;
int UserIsTyping(MCONTACT hContact, int type) override;
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index 303753b7ee..3b6f13c7b3 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -243,7 +243,7 @@ int WhatsAppProto::SetStatus(int iNewStatus)
/////////////////////////////////////////////////////////////////////////////////////////
-int WhatsAppProto::SendMsg(MCONTACT hContact, const char *pszMsg)
+int WhatsAppProto::SendMsg(MCONTACT hContact, MEVENT, const char *pszMsg)
{
if (!isOnline())
return -1;
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h
index 01ab9ba043..10cc2a068c 100644
--- a/protocols/WhatsApp/src/proto.h
+++ b/protocols/WhatsApp/src/proto.h
@@ -466,7 +466,7 @@ public:
MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
HANDLE SearchBasic(const wchar_t* id) override;
- int SendMsg(MCONTACT hContact, const char* msg) override;
+ int SendMsg(MCONTACT hContact, MEVENT, const char* msg) override;
int SetStatus(int iNewStatus) override;
int UserIsTyping(MCONTACT hContact, int type) override;
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index ba74665e56..36020e3579 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -63,7 +63,7 @@ Button_SetSkin_IcoLib @24
?SearchByName@PROTO_INTERFACE@@UAEPAXPB_W00@Z @65 NONAME
?SendContacts@PROTO_INTERFACE@@UAEHIHHPAI@Z @66 NONAME
?SendFile@PROTO_INTERFACE@@UAEPAXIPB_WPAPA_W@Z @67 NONAME
-?SendMsg@PROTO_INTERFACE@@UAEHIPBD@Z @68 NONAME
+?SendMsg@PROTO_INTERFACE@@UAEHIIPBD@Z @68 NONAME
?SetApparentMode@PROTO_INTERFACE@@UAEHIH@Z @70 NONAME
?SetAwayMsg@PROTO_INTERFACE@@UAEHHPB_W@Z @71 NONAME
?SetStatus@PROTO_INTERFACE@@UAEHH@Z @72 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 257fa93dfd..3ec92dc0dc 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -63,7 +63,7 @@ Button_SetSkin_IcoLib @24
?SearchByName@PROTO_INTERFACE@@UEAAPEAXPEB_W00@Z @65 NONAME
?SendContacts@PROTO_INTERFACE@@UEAAHIHHPEAI@Z @66 NONAME
?SendFile@PROTO_INTERFACE@@UEAAPEAXIPEB_WPEAPEA_W@Z @67 NONAME
-?SendMsg@PROTO_INTERFACE@@UEAAHIPEBD@Z @68 NONAME
+?SendMsg@PROTO_INTERFACE@@UEAAHIIPEBD@Z @68 NONAME
?SetApparentMode@PROTO_INTERFACE@@UEAAHIH@Z @70 NONAME
?SetAwayMsg@PROTO_INTERFACE@@UEAAHHPEB_W@Z @71 NONAME
?SetStatus@PROTO_INTERFACE@@UEAAHH@Z @72 NONAME
diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp
index 88488be82c..00d7fb2f26 100644
--- a/src/mir_app/src/proto_interface.cpp
+++ b/src/mir_app/src/proto_interface.cpp
@@ -255,7 +255,7 @@ HANDLE PROTO_INTERFACE::SendFile(MCONTACT, const wchar_t*, wchar_t**)
return nullptr; // error
}
-int PROTO_INTERFACE::SendMsg(MCONTACT, const char*)
+int PROTO_INTERFACE::SendMsg(MCONTACT, MEVENT, const char*)
{
return 0; // error
}
diff --git a/src/mir_app/src/proto_internal.cpp b/src/mir_app/src/proto_internal.cpp
index b8d0cabb5c..b876e221ea 100644
--- a/src/mir_app/src/proto_internal.cpp
+++ b/src/mir_app/src/proto_internal.cpp
@@ -209,9 +209,9 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return res;
}
- int SendMsg(MCONTACT hContact, const char *msg) override
+ int SendMsg(MCONTACT hContact, MEVENT hEvent, const char *msg) override
{
- CCSDATA ccs = { hContact, PSS_MESSAGE, 0, (LPARAM)msg };
+ CCSDATA ccs = { hContact, PSS_MESSAGE, hEvent, (LPARAM)msg };
return (int)ProtoCallService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs);
}
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp
index 6a472ee64e..bafd0d0d04 100644
--- a/src/mir_app/src/protocols.cpp
+++ b/src/mir_app/src/protocols.cpp
@@ -425,7 +425,7 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char
case 23: return (INT_PTR)ppi->SendContacts(hContact, LOWORD(wParam), HIWORD(wParam), (MCONTACT *)lParam);
case 24: return (INT_PTR)ppi->SendFile(hContact, (wchar_t *)wParam, (wchar_t **)lParam);
case 25: {
- int msgId = ppi->SendMsg(hContact, (const char *)lParam);
+ int msgId = ppi->SendMsg(hContact, wParam, (const char *)lParam);
if (msgId == -1) {
ppi->ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)-1, (LPARAM)TranslateT("Protocol is offline"));
return -1;