diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-09-27 11:44:58 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-09-27 11:44:58 +0000 |
commit | 0c7b52a9973306c6896f3dd8e46eb9bcc4cffffb (patch) | |
tree | 2f345aa6bd587e5593cc262ad4a9bcbbf2231230 /protocols/FacebookRM/src/process.cpp | |
parent | dae67fa8059f77a0bd2cbf7e69e0a2d6a3e59a3f (diff) |
Facebook: Save names separately into first, second and last name fields
git-svn-id: http://svn.miranda-ng.org/main/trunk@6247 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index edb554f9f8..2643a899ab 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -173,25 +173,29 @@ void FacebookProto::ProcessFriendList(void* data) // Found contact, update it and remove from map
fbu = iter->second;
- DBVARIANT dbv;
- bool update_required = true;
-
// TODO RM: remove, because contacts cant change it, so its only for "first run"
// - but what with contacts, that was added after logon?
// Update gender
if (getByte(hContact, "Gender", 0) != fbu->gender)
setByte(hContact, "Gender", fbu->gender);
- // Update real name
- if (!db_get_utf(hContact, m_szModuleName, FACEBOOK_KEY_NAME, &dbv))
+ // Update name
+ DBVARIANT dbv;
+ bool update_required = true;
+
+ // TODO: remove in some future version?
+ ptrA realname(getStringA(hContact, "RealName"));
+ if (realname != NULL) {
+ delSetting(hContact, "RealName");
+ }
+ else if (!db_get_utf(hContact, m_szModuleName, FACEBOOK_KEY_NICK, &dbv))
{
update_required = strcmp(dbv.pszVal, fbu->real_name.c_str()) != 0;
db_free(&dbv);
}
if (update_required)
{
- db_set_utf(hContact, m_szModuleName, FACEBOOK_KEY_NAME, fbu->real_name.c_str());
- db_set_utf(hContact, m_szModuleName, FACEBOOK_KEY_NICK, fbu->real_name.c_str());
+ SaveName(hContact, fbu);
}
if (getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, 0) != CONTACT_FRIEND) {
@@ -224,7 +228,7 @@ void FacebookProto::ProcessFriendList(void* data) setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, CONTACT_NONE);
std::string contactname = id;
- if (!db_get_utf(hContact, m_szModuleName, FACEBOOK_KEY_NAME, &dbv)) {
+ if (!db_get_utf(hContact, m_szModuleName, FACEBOOK_KEY_NICK, &dbv)) {
contactname = dbv.pszVal;
db_free(&dbv);
}
|