From e89765da6a2c6e5efb6e019ebd037e0d3f1565b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Thu, 4 Dec 2014 14:00:27 +0000 Subject: Steam: Don't try delete contact from server when we're not friends anyway git-svn-id: http://svn.miranda-ng.org/main/trunk@11241 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_contacts.cpp | 5 ++++- protocols/Steam/src/steam_proto.cpp | 10 ++++++++-- 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; -- cgit v1.2.3