summaryrefslogtreecommitdiff
path: root/protocols/Steam/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Steam/src')
-rw-r--r--protocols/Steam/src/steam_contacts.cpp5
-rw-r--r--protocols/Steam/src/steam_proto.cpp10
2 files changed, 12 insertions, 3 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp
index f0498f25f6..582e7f5b20 100644
--- a/protocols/Steam/src/steam_contacts.cpp
+++ b/protocols/Steam/src/steam_contacts.cpp
@@ -463,7 +463,10 @@ void CSteamProto::OnFriendRemoved(const NETLIBHTTPREQUEST *response, void *arg)
{
if (response == NULL || response->resultCode != HTTP_STATUS_OK || lstrcmpiA(response->pData, "true"))
{
- debugLogA("CSteamProto::OnFriendRemoved: failed to remove friend %s", ptrA((char*)arg));
+ MCONTACT hContact = (MCONTACT)arg;
+ ptrA who(getStringA(hContact, "SteamID"));
+
+ debugLogA("CSteamProto::OnFriendRemoved: failed to remove friend %s", who);
return;
}
}
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index e4668ebe38..f2878659f0 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -386,15 +386,21 @@ int __cdecl CSteamProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM
case EV_PROTO_ONCONTACTDELETED:
if (IsOnline())
{
+ MCONTACT hContact = (MCONTACT)wParam;
+
ptrA token(getStringA("TokenSecret"));
ptrA sessionId(getStringA("SessionID"));
ptrA steamId(getStringA("SteamID"));
- char *who = getStringA(wParam, "SteamID");
+ ptrA who(getStringA(hContact, "SteamID"));
+
+ // Don't request delete contact from server when we're not friends anyway
+ if (getByte(hContact, "Auth", 0) != 0)
+ return 0;
PushRequest(
new SteamWebApi::RemoveFriendRequest(token, sessionId, steamId, who),
&CSteamProto::OnFriendRemoved,
- who);
+ (void*)hContact);
}
return 0;