From 1338ad89ee45bdb681c531476dca00a377d7d033 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 3 Dec 2023 17:14:30 +0300 Subject: PROTO_INTERFACE::SendMsg: second parameter became a reply event id --- protocols/Discord/src/proto.cpp | 2 +- protocols/Discord/src/proto.h | 2 +- protocols/Dummy/src/dummy_proto.cpp | 2 +- protocols/Dummy/src/dummy_proto.h | 2 +- protocols/Facebook/src/groupchats.cpp | 2 +- protocols/Facebook/src/proto.cpp | 2 +- protocols/Facebook/src/proto.h | 2 +- protocols/Gadu-Gadu/src/gg_proto.cpp | 2 +- protocols/Gadu-Gadu/src/gg_proto.h | 2 +- protocols/ICQ-WIM/src/groupchats.cpp | 2 +- protocols/ICQ-WIM/src/proto.cpp | 2 +- protocols/ICQ-WIM/src/proto.h | 2 +- protocols/IRCG/src/ircproto.cpp | 2 +- protocols/IRCG/src/ircproto.h | 2 +- protocols/JabberG/src/jabber_chat.cpp | 2 +- protocols/JabberG/src/jabber_omemo.cpp | 2 +- protocols/JabberG/src/jabber_proto.cpp | 2 +- protocols/JabberG/src/jabber_proto.h | 2 +- protocols/Sametime/src/sametime_proto.cpp | 2 +- protocols/Sametime/src/sametime_proto.h | 2 +- protocols/SkypeWeb/src/skype_messages.cpp | 2 +- protocols/SkypeWeb/src/skype_proto.h | 2 +- protocols/Steam/src/steam_proto.cpp | 2 +- protocols/Steam/src/steam_proto.h | 2 +- protocols/Telegram/src/groupchat.cpp | 2 +- protocols/Telegram/src/proto.cpp | 11 +++++++++-- protocols/Telegram/src/proto.h | 4 ++-- protocols/Telegram/src/server.cpp | 3 ++- protocols/Tox/src/tox_proto.cpp | 2 +- protocols/Tox/src/tox_proto.h | 2 +- protocols/Twitter/src/proto.cpp | 2 +- protocols/Twitter/src/proto.h | 2 +- protocols/VKontakte/src/vk_chats.cpp | 2 +- protocols/VKontakte/src/vk_messages.cpp | 4 ++-- protocols/VKontakte/src/vk_proto.h | 2 +- protocols/WhatsApp/src/proto.cpp | 2 +- protocols/WhatsApp/src/proto.h | 2 +- 37 files changed, 48 insertions(+), 40 deletions(-) (limited to 'protocols') 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 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 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 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 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, 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 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 . /* 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 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(); 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 . ////////////////////////////////////////////////////////////////////////////// -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 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; -- cgit v1.2.3