diff options
author | George Hazan <ghazan@miranda.im> | 2019-08-26 14:57:51 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-08-26 14:57:51 +0300 |
commit | 93a09024ab433c866e87c5a6e33f982d7e8e32ab (patch) | |
tree | 13f86c292e2f4a628834a55466e27993ca99864a /protocols/FacebookRM/src | |
parent | cb2efce1a4fe9c89c5fef63b3aca63f3e63983fc (diff) |
unified fake User-Agent field generation for all http-related protocols
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/main.cpp | 5 | ||||
-rw-r--r-- | protocols/FacebookRM/src/stdafx.h | 1 |
3 files changed, 1 insertions, 7 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 7d0dfaa86f..3b9f97d235 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -47,7 +47,7 @@ http::response facebook_client::sendRequest(HttpRequest *request) request->AddHeader("Accept-Language", "en,en-US;q=0.9"); request->AddHeader("Accept", "*/*"); - request->AddHeader("User-Agent", g_strUserAgent.c_str()); + request->AddHeader("User-Agent", Netlib_GetUserAgent()); request->AddHeader("Cookie", ptrA(load_cookies())); // FIXME: Rework load_cookies to not do strdup if (request->requestType == REQUEST_POST) diff --git a/protocols/FacebookRM/src/main.cpp b/protocols/FacebookRM/src/main.cpp index b309767406..bf80befe1c 100644 --- a/protocols/FacebookRM/src/main.cpp +++ b/protocols/FacebookRM/src/main.cpp @@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. CMPlugin g_plugin;
-std::string g_strUserAgent;
DWORD g_mirandaVersion;
bool g_bMessageState;
HWND g_hwndHeartbeat;
@@ -75,12 +74,8 @@ int CMPlugin::Load() InitIcons();
InitContactMenus();
- // Init native User-Agent
- g_strUserAgent = "Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Firefox/52.0";
-
// Initialize random generator (used only as fallback in utils)
srand(::time(0));
-
return 0;
}
diff --git a/protocols/FacebookRM/src/stdafx.h b/protocols/FacebookRM/src/stdafx.h index 3a96f387de..75241dfa99 100644 --- a/protocols/FacebookRM/src/stdafx.h +++ b/protocols/FacebookRM/src/stdafx.h @@ -79,7 +79,6 @@ class FacebookProto; #include "resource.h"
#include "version.h"
-extern std::string g_strUserAgent;
extern DWORD g_mirandaVersion;
extern bool g_bMessageState;
extern HWND g_hwndHeartbeat;
|