diff options
| author | George Hazan <george.hazan@gmail.com> | 2025-01-05 22:34:04 +0300 |
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2025-01-05 22:34:04 +0300 |
| commit | 521cc2d8e239cca75e7c565f574e4573cb109429 (patch) | |
| tree | a89509b1cdccd6ce5bdbc411ed62949f0be59dc3 /protocols/Steam/src/steam_messages.cpp | |
| parent | 3507f4a22af26c47c547012ba5189cee6c59d5fa (diff) | |
Steam: basic group chat support
Diffstat (limited to 'protocols/Steam/src/steam_messages.cpp')
| -rw-r--r-- | protocols/Steam/src/steam_messages.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index 8c8cfab442..da65a5b424 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -1,42 +1,32 @@ #include "stdafx.h"
-int64_t CSteamProto::SendFriendMessage(EChatEntryType entry_type, int64_t steamId, const char *pszMessage)
+void CSteamProto::SendFriendMessage(EChatEntryType entry_type, int64_t steamId, const char *pszMessage, void *pInfo)
{
CFriendMessagesSendMessageRequest request;
request.chat_entry_type = (int)entry_type; request.has_chat_entry_type = true;
request.contains_bbcode = request.has_contains_bbcode = true;
request.steamid = steamId; request.has_steamid = true;
request.message = (char *)pszMessage;
- return WSSendService(FriendSendMessage, request);
+ WSSendService(FriendSendMessage, request, pInfo);
}
void CSteamProto::OnMessageSent(const CFriendMessagesSendMessageResponse &reply, const CMsgProtoBufHeader &hdr)
{
- COwnMessage tmp(0, 0);
- {
- mir_cslock lck(m_csOwnMessages);
- for (auto &it : m_arOwnMessages)
- if (it->iSourceId == hdr.jobid_target) {
- tmp = *it;
- m_arOwnMessages.remove(m_arOwnMessages.indexOf(&it));
- break;
- }
- }
-
- if (!tmp.hContact)
+ auto *pOwn = (COwnMessage*)GetRequestInfo(hdr.jobid_target);
+ if (pOwn == nullptr)
return;
if (hdr.failed()) {
CMStringW wszMessage(FORMAT, TranslateT("Message sending has failed with error %d"), hdr.eresult);
- ProtoBroadcastAck(tmp.hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)tmp.iMessageId, (LPARAM)wszMessage.c_str());
+ ProtoBroadcastAck(pOwn->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)pOwn->iMessageId, (LPARAM)wszMessage.c_str());
}
else {
uint32_t timestamp = (reply.has_server_timestamp) ? reply.server_timestamp : 0;
- if (timestamp > getDword(tmp.hContact, DBKEY_LASTMSG))
- setDword(tmp.hContact, DBKEY_LASTMSG, timestamp);
+ if (timestamp > getDword(pOwn->hContact, DBKEY_LASTMSG))
+ setDword(pOwn->hContact, DBKEY_LASTMSG, timestamp);
- tmp.timestamp = timestamp;
- ProtoBroadcastAck(tmp.hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)tmp.iMessageId, 0);
+ pOwn->timestamp = timestamp;
+ ProtoBroadcastAck(pOwn->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)pOwn->iMessageId, 0);
}
}
|
