summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-12-21 18:31:46 +0000
committerRobert Pösel <robyer@seznam.cz>2012-12-21 18:31:46 +0000
commitaf1424f225d57168297e1be919343ff7d8e25d11 (patch)
tree6eaec88780103262ff1ee2e0154e4fb60f8d174c /protocols
parentb3e0d5a4ed673b3ad80da1934359ee8c6606e1f4 (diff)
Facebook: Fixed Visit Profile
git-svn-id: http://svn.miranda-ng.org/main/trunk@2779 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/proto.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 2fcc2177ba..657c36c00a 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -480,28 +480,28 @@ int FacebookProto::RefreshBuddyList(WPARAM, LPARAM)
int FacebookProto::VisitProfile(WPARAM wParam,LPARAM lParam)
-{
- HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+{
+ HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
+ std::string url = FACEBOOK_URL_PROFILE;
DBVARIANT dbv;
- if ( wParam != 0 && !DBGetContactSettingString(hContact,m_szModuleName,"Homepage",&dbv))
- {
- CallService(MS_UTILS_OPENURL,1,reinterpret_cast<LPARAM>(dbv.pszVal));
- DBFreeVariant(&dbv);
- }
- else if (DBGetContactSettingByte(hContact,m_szModuleName,"ChatRoom",0))
- {
- std::string url = FACEBOOK_URL_GROUP;
- if (!DBGetContactSettingString(hContact,m_szModuleName,"ChatRoomID",&dbv)) {
+
+ // TODO: why isn't wParam == 0 when is status menu moved to main menu?
+ if (wParam != 0 && IsMyContact(hContact)) {
+ if (!DBGetContactSettingString(hContact, m_szModuleName, "Homepage", &dbv)) {
+ // Homepage link already present, get it
+ url = dbv.pszVal;
+ DBFreeVariant(&dbv);
+ } else if (!DBGetContactSettingString(hContact, m_szModuleName, FACEBOOK_KEY_ID, &dbv)) {
+ // No homepage link, create and save it
url += dbv.pszVal;
+ DBWriteContactSettingString(hContact, m_szModuleName, "Homepage", url.c_str());
DBFreeVariant(&dbv);
}
- CallService(MS_UTILS_OPENURL,1,reinterpret_cast<LPARAM>(url.c_str()));
- } else {
- // TODO: why isn't wParam == 0 when is status menu moved to main menu?
- CallService(MS_UTILS_OPENURL,1,reinterpret_cast<LPARAM>(FACEBOOK_URL_PROFILE));
}
+ CallService(MS_UTILS_OPENURL, 1, reinterpret_cast<LPARAM>(url.c_str()));
+
return 0;
}