From 99081c722ac293e30d993b504851bf096b3cd5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Thu, 19 Jun 2014 10:39:56 +0000 Subject: 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 --- protocols/FacebookRM/src/process.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'protocols/FacebookRM/src/process.cpp') 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? -- cgit v1.2.3