diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-03-19 00:12:54 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-03-19 00:12:54 +0000 |
commit | 887abb55d8fe93f158ce21eb1ecce4375ddabccb (patch) | |
tree | 6083645b7711fcb7d43088ceead3ce0cd4d1b54f /protocols/FacebookRM/src/proto.cpp | |
parent | 4c6d7054a9d545c8d8978b6fe1d1f8a89119f2c7 (diff) |
Facebook: Implemented function to manually refresh contact info; version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@8656 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/proto.cpp')
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 7ec20b4790..1627cecb13 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -311,6 +311,34 @@ int FacebookProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *reason) return 0;
}
+int FacebookProto::GetInfo(MCONTACT hContact, int infoType)
+{
+ facebook_user fbu;
+ fbu.user_id = ptrA(getStringA(hContact, FACEBOOK_KEY_ID));
+
+ if (fbu.user_id.empty())
+ return 1;
+
+ LoadContactInfo(&fbu);
+
+ // TODO: don't duplicate code this way, refactor all this userInfo loading
+
+ std::string homepage = FACEBOOK_URL_PROFILE + fbu.user_id;
+ setString(hContact, "Homepage", homepage.c_str());
+
+ if (!fbu.real_name.empty()) {
+ SaveName(hContact, &fbu);
+ }
+
+ if (fbu.gender)
+ setByte(hContact, "Gender", fbu.gender);
+
+ if (!fbu.image_url.empty())
+ setString(hContact, FACEBOOK_KEY_AV_URL, fbu.image_url.c_str());
+
+ return 1;
+}
+
//////////////////////////////////////////////////////////////////////////////
// SERVICES
|