From 42c1d344fd105bcc25ae35e5a82d16a978b302c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 20 Jul 2014 07:46:19 +0000 Subject: Facebook: Don't do any requests when protocol is offline git-svn-id: http://svn.miranda-ng.org/main/trunk@9875 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/communication.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'protocols/FacebookRM/src/communication.cpp') diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index f3e0c19c85..b2eea131b5 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -29,6 +29,13 @@ void facebook_client::client_notify(TCHAR* message) http::response facebook_client::flap(RequestType request_type, std::string* request_data, std::string* request_get_data, int method) { + http::response resp; + + if (parent->isOffline) { + resp.code = HTTP_CODE_FAKE_OFFLINE; + return resp; + } + NETLIBHTTPREQUEST nlhr = {sizeof(NETLIBHTTPREQUEST)}; nlhr.requestType = !method ? choose_method(request_type) : method; @@ -85,8 +92,6 @@ http::response facebook_client::flap(RequestType request_type, std::string* requ mir_free(nlhr.headers[3].szValue); mir_free(nlhr.headers); - http::response resp; - switch (request_type) { case REQUEST_LOGIN: -- cgit v1.2.3