diff options
author | George Hazan <george.hazan@gmail.com> | 2025-04-24 18:37:06 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-04-24 18:37:06 +0300 |
commit | d8ef7ec807a4a517896ead1e98f366f06b29c76a (patch) | |
tree | ef19ef16a8b38db0d063ef6d0e743dea15b10a8c /protocols/Teams/src/teams_messages.cpp | |
parent | 53e0b5f3ff938adf11b2237727510e07e23ffdb6 (diff) |
Teams: fix for sending messages to group chats
Diffstat (limited to 'protocols/Teams/src/teams_messages.cpp')
-rw-r--r-- | protocols/Teams/src/teams_messages.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/protocols/Teams/src/teams_messages.cpp b/protocols/Teams/src/teams_messages.cpp index 9c29ee3827..4b3a0a96da 100644 --- a/protocols/Teams/src/teams_messages.cpp +++ b/protocols/Teams/src/teams_messages.cpp @@ -26,9 +26,6 @@ void CTeamsProto::OnMessageSent(MHttpResponse *response, AsyncHttpRequest *pRequ std::unique_ptr<COwnMessage> pMessage((COwnMessage *)pRequest->pUserInfo); MCONTACT hContact = pRequest->hContact; - if (Contact::IsGroupChat(hContact)) - return; - if (response == nullptr) { ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, pRequest->pUserInfo, (LPARAM)TranslateT("Network error!")); return; @@ -40,8 +37,19 @@ void CTeamsProto::OnMessageSent(MHttpResponse *response, AsyncHttpRequest *pRequ CMStringA msgId(pRoot["OriginalArrivalTime"].as_mstring()); if (pMessage) { - pMessage->iTimestamp = _atoi64(msgId); - ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)pMessage->hMessage, (LPARAM)msgId.c_str()); + if (auto *si = Chat_Find(hContact)) { + GCEVENT gce = { si, GC_EVENT_MESSAGE }; + gce.dwFlags = GCEF_ADDTOLOG | GCEF_UTF8; + gce.pszUID.a = m_szOwnSkypeId; + gce.pszText.a = pMessage->szMessage; + gce.time = time(0); + gce.bIsMe = true; + Chat_Event(&gce); + } + else { + pMessage->iTimestamp = _atoi64(msgId); + ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)pMessage->hMessage, (LPARAM)msgId.c_str()); + } mir_cslock lck(m_lckOutMessagesList); m_OutMessages.remove(pMessage.get()); |