diff options
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 30 |
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;
}
|