summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2016-07-16 13:38:12 +0000
committerRobert Pösel <robyer@seznam.cz>2016-07-16 13:38:12 +0000
commitd72c053ee228aa9cf054970e2b444f0409a3504f (patch)
tree7b40dc9a5818ec7a1031bdb98354deb97db8dfef /protocols/FacebookRM/src
parent0bb0c182d694b7c1f4184e8da17d68705c441d8c (diff)
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
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r--protocols/FacebookRM/src/contacts.cpp12
1 files changed, 12 insertions, 0 deletions
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())