diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-12-04 14:00:27 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-12-04 14:00:27 +0000 |
commit | e89765da6a2c6e5efb6e019ebd037e0d3f1565b0 (patch) | |
tree | d4ba2c6bf520c313a2975240fc12040a9d4ce761 /protocols/Steam/src | |
parent | f16b4030068686b9f8bc1c4d22cd8c52b78a21d0 (diff) |
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
Diffstat (limited to 'protocols/Steam/src')
-rw-r--r-- | protocols/Steam/src/steam_contacts.cpp | 5 | ||||
-rw-r--r-- | 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;
|