diff options
author | George Hazan <george.hazan@gmail.com> | 2024-12-15 15:50:25 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-12-15 15:50:25 +0300 |
commit | 4bbe001b15dec9cacd882ee55fe54f85c56a147f (patch) | |
tree | f181de7f9180492ac67a4a724697aad48eb6edb7 /protocols/Steam/src/steam_proto.cpp | |
parent | d2c72c9bf3492fd40960c2f0935c9c675795d28a (diff) |
Steam: service calls switched to static handlers
Diffstat (limited to 'protocols/Steam/src/steam_proto.cpp')
-rw-r--r-- | protocols/Steam/src/steam_proto.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index c93951749f..14d79c8beb 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -224,6 +224,21 @@ HANDLE CSteamProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, return (HANDLE)STEAM_SEARCH_BYNAME;
}
+int CSteamProto::SendMsg(MCONTACT hContact, MEVENT, const char *message)
+{
+ if (!IsOnline())
+ return -1;
+
+ UINT hMessage = InterlockedIncrement(&hMessageProcess);
+ {
+ mir_cslock lck(m_csOwnMessages);
+ m_arOwnMessages.insert(new COwnMessage(hContact, hMessage));
+ }
+
+ SendFriendMessage(hMessage, GetId(hContact, DBKEY_STEAM_ID), message);
+ return hMessage;
+}
+
int CSteamProto::SetStatus(int new_status)
{
// Routing statuses not supported by Steam
@@ -277,6 +292,8 @@ int CSteamProto::SetStatus(int new_status) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
void CSteamProto::GetAwayMsgThread(void *arg)
{
// Maybe not needed, but better to be sure that this won't happen faster than core handling return value of GetAwayMsg()
@@ -305,6 +322,8 @@ HANDLE CSteamProto::GetAwayMsg(MCONTACT hContact) return (HANDLE)1;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
bool CSteamProto::OnContactDeleted(MCONTACT hContact, uint32_t)
{
// remove only authorized contacts
@@ -315,3 +334,17 @@ bool CSteamProto::OnContactDeleted(MCONTACT hContact, uint32_t) }
return true;
}
+
+int CSteamProto::OnPreCreateMessage(WPARAM, LPARAM lParam)
+{
+ MessageWindowEvent *evt = (MessageWindowEvent *)lParam;
+ if (!mir_strcmp(Proto_GetBaseAccountName(evt->hContact), m_szModuleName)) {
+ mir_cslock lck(m_csOwnMessages);
+ if (auto *pOwn = m_arOwnMessages.find((COwnMessage *)&evt->seq)) {
+ evt->dbei->timestamp = pOwn->timestamp;
+ m_arOwnMessages.remove(pOwn);
+ }
+ }
+
+ return 0;
+}
|