From d72c053ee228aa9cf054970e2b444f0409a3504f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 16 Jul 2016 13:38:12 +0000 Subject: Facebook: Use "[Page]" prefix for "page" contact's nickname and don't split it to first/second/last names git-svn-id: http://svn.miranda-ng.org/main/trunk@17101 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/contacts.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'protocols') diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 6ecc9ba5f4..242f0a5bb7 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -38,6 +38,18 @@ void updateStringUtf(FacebookProto *proto, MCONTACT hContact, const char *key, c void FacebookProto::SaveName(MCONTACT hContact, const facebook_user *fbu) { + if (fbu->type == CONTACT_PAGE) { + // Page has only nickname and no first/last names + std::string nick = Translate("[Page]"); // page prefix + nick += " " + fbu->real_name; + + updateStringUtf(this, hContact, FACEBOOK_KEY_NICK, nick); + delSetting(hContact, FACEBOOK_KEY_FIRST_NAME); + delSetting(hContact, FACEBOOK_KEY_SECOND_NAME); + delSetting(hContact, FACEBOOK_KEY_LAST_NAME); + return; + } + // Save nick std::string nick = fbu->real_name; if (!getBool(FACEBOOK_KEY_NAME_AS_NICK, 1) && !fbu->nick.empty()) -- cgit v1.2.3