summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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())