From 87c333c782b643cfc93b87f71db92d8c7e983aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 12 Dec 2015 09:07:40 +0000 Subject: Facebook: Visibility/away improvements * Mark contacts last active more than 1 minute ago as away * Don't make us active for FB when we're invisible or away git-svn-id: http://svn.miranda-ng.org/main/trunk@15843 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/communication.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'protocols/FacebookRM/src/communication.cpp') diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 2a2fe90333..047a71a0d9 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -450,7 +450,8 @@ std::string facebook_client::choose_action(RequestType request_type, std::string */ int idleSeconds = parent->IdleSeconds(); - action += "&idle=" + utils::conversion::to_string(&idleSeconds, UTILS_CONV_UNSIGNED_NUMBER); + if (idleSeconds > 0 && !parent->isInvisible()) + action += "&idle=" + utils::conversion::to_string(&idleSeconds, UTILS_CONV_UNSIGNED_NUMBER); action += "&cap=0"; // TODO: what's this item? Sometimes it's 0, sometimes 8 // action += "&wtc=0,0,0.000,0,0"; // TODO: what's this item? It's numbers grows with every new request... @@ -1207,6 +1208,10 @@ bool facebook_client::channel() bool facebook_client::activity_ping() { + // Don't send ping when we are not online + if (parent->m_iStatus != ID_STATUS_ONLINE) + return true; + handle_entry("activity_ping"); http::response resp = flap(REQUEST_ACTIVE_PING); -- cgit v1.2.3