summaryrefslogtreecommitdiff
path: root/protocols/Steam/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Steam/src')
-rw-r--r--protocols/Steam/src/steam_history.cpp20
-rw-r--r--protocols/Steam/src/steam_proto.cpp1
-rw-r--r--protocols/Steam/src/steam_proto.h1
3 files changed, 22 insertions, 0 deletions
diff --git a/protocols/Steam/src/steam_history.cpp b/protocols/Steam/src/steam_history.cpp
index 839bd66ed0..b3c409c71d 100644
--- a/protocols/Steam/src/steam_history.cpp
+++ b/protocols/Steam/src/steam_history.cpp
@@ -10,6 +10,26 @@ INT_PTR CSteamProto::SvcEmptyHistory(WPARAM, LPARAM)
return 1;
}
+INT_PTR CSteamProto::SvcLoadServerHistory(WPARAM hContact, LPARAM)
+{
+ if (Contact::IsGroupChat(hContact)) {
+ CChatRoomGetMessageHistoryRequest request;
+ request.chat_group_id = GetId(hContact, DBKEY_STEAM_ID); request.has_chat_group_id = true;
+ request.chat_id = getDword(hContact, "ChatId"); request.has_chat_id = true;
+ request.max_count = 100; request.has_max_count = true;
+ WSSendService(GetChatHistory, request, (void *)hContact);
+ }
+ else {
+ CFriendMessagesGetRecentMessagesRequest request;
+ request.steamid1 = m_iSteamId; request.has_steamid1 = true;
+ request.steamid2 = GetId(hContact, DBKEY_STEAM_ID); request.has_steamid2 = true;
+ request.count = 100; request.has_count = true;
+ request.most_recent_conversation = request.has_most_recent_conversation = true;
+ WSSendService(FriendGetRecentMessages, request);
+ }
+ return 0;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
void CSteamProto::SendHistoryRequest(uint64_t accountId, uint32_t startTime)
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index 172da982e4..b6822d1db2 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -25,6 +25,7 @@ CSteamProto::CSteamProto(const char *protoName, const wchar_t *userName) :
CreateProtoService(PS_GETMYAVATAR, &CSteamProto::GetMyAvatar);
// history
+ CreateProtoService(PS_MENU_LOADHISTORY, &CSteamProto::SvcLoadServerHistory);
CreateProtoService(PS_CAN_EMPTY_HISTORY, &CSteamProto::SvcCanEmptyHistory);
CreateProtoService(PS_EMPTY_SRV_HISTORY, &CSteamProto::SvcEmptyHistory);
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h
index d416e76650..70a00da312 100644
--- a/protocols/Steam/src/steam_proto.h
+++ b/protocols/Steam/src/steam_proto.h
@@ -283,6 +283,7 @@ class CSteamProto : public PROTO<CSteamProto>
void OnSearchByNameStarted(const MHttpResponse &response, void *arg);
// history
+ INT_PTR __cdecl SvcLoadServerHistory(WPARAM, LPARAM);
INT_PTR __cdecl SvcCanEmptyHistory(WPARAM, LPARAM);
INT_PTR __cdecl SvcEmptyHistory(WPARAM, LPARAM);