diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-06-19 10:39:56 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-06-19 10:39:56 +0000 |
commit | 99081c722ac293e30d993b504851bf096b3cd5d8 (patch) | |
tree | e11cdb2040cb2ac9bb4cca7f36527c1eb48fcd04 /protocols/FacebookRM/src/process.cpp | |
parent | 8cc704c0ac76ac635b2ca5e40ce5a21f2686156a (diff) |
Facebook: Save contact's username into database (as key "Username")
git-svn-id: http://svn.miranda-ng.org/main/trunk@9541 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 7c4584f5f0..2f13369f5a 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -210,6 +210,16 @@ void FacebookProto::ProcessFriendList(void*) SaveName(hContact, fbu); } + // Update username + ptrA username(getStringA(hContact, FACEBOOK_KEY_USERNAME)); + if (!username || strcmp(username, fbu->username.c_str())) { + if (!fbu->username.empty()) + setString(hContact, FACEBOOK_KEY_USERNAME, fbu->username.c_str()); + else + delSetting(hContact, FACEBOOK_KEY_USERNAME); + } + + // Update contact type if (getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, 0) != CONTACT_FRIEND) { setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, CONTACT_FRIEND); // TODO: remove that popup and use "Contact added you" event? |