summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/process.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2017-01-23 01:07:41 +0100
committerRobert Pösel <robyer@seznam.cz>2017-01-23 01:07:41 +0100
commit26890d819c469ffc7a01352d828eeaf659f82be8 (patch)
treea628deafb53be6887ebe6888f118d9c4bf2a00c4 /protocols/FacebookRM/src/process.cpp
parent0151cac1704717e5eee6859e4d3b8eeb043d901f (diff)
Facebook: Add option to make Pages always invisible (enabled by default)
FB Pages are not online or offline, they just are. And this options helps users to find them in their contact list easily.
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r--protocols/FacebookRM/src/process.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 33a451204e..0f4a4e736e 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -60,6 +60,7 @@ void FacebookProto::ProcessFriendList(void*)
std::map<std::string, facebook_user*> friends;
bool loadAllContacts = getBool(FACEBOOK_KEY_LOAD_ALL_CONTACTS, DEFAULT_LOAD_ALL_CONTACTS);
+ bool pagesAlwaysOnline = getBool(FACEBOOK_KEY_PAGES_ALWAYS_ONLINE, DEFAULT_PAGES_ALWAYS_ONLINE);
facebook_json_parser* p = new facebook_json_parser(this);
p->parse_friends(&resp.data, &friends, loadAllContacts);
@@ -77,6 +78,11 @@ void FacebookProto::ProcessFriendList(void*)
setDword(hContact, FACEBOOK_KEY_DELETED, deletedTS);
}
+ // If this contact is page, set it as invisible (if enabled in options)
+ if (pagesAlwaysOnline && getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, CONTACT_NONE) == CONTACT_PAGE) {
+ setWord(hContact, "Status", ID_STATUS_ONLINE);
+ }
+
facebook_user *fbu;
ptrA id(getStringA(hContact, FACEBOOK_KEY_ID));
if (id != NULL) {