summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/proto.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-05-30 10:54:41 +0000
committerRobert Pösel <robyer@seznam.cz>2014-05-30 10:54:41 +0000
commit7423c0fa346a9aee044f6fa8dc88f666f9092dc1 (patch)
tree3db777ef1a0caac2a2c330018a17e967017b001f /protocols/FacebookRM/src/proto.cpp
parenta1327f90bbf4278beb8874ba9e39dde455dade8b (diff)
Facebook: Added hidden option to open url's in different browser
It's unicode string with name "OpenUrlBrowser", value is path to browser, in account's branch. git-svn-id: http://svn.miranda-ng.org/main/trunk@9366 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/proto.cpp')
-rw-r--r--protocols/FacebookRM/src/proto.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index d97aa419e1..9a5fd73d02 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -751,6 +751,17 @@ MCONTACT FacebookProto::HContactFromAuthEvent(HANDLE hEvent)
return DbGetAuthEventContact(&dbei);
}
+void FacebookProto::OpenUrlThread(void *p) {
+ if (p == NULL)
+ return;
+
+ open_url *data = static_cast<open_url*>(p);
+
+ ShellExecute(NULL, _T("open"), data->browser, data->url, NULL, SW_SHOWDEFAULT);
+
+ delete data;
+}
+
void FacebookProto::OpenUrl(std::string url)
{
std::string::size_type pos = url.find(FACEBOOK_SERVER_DOMAIN);
@@ -775,7 +786,15 @@ void FacebookProto::OpenUrl(std::string url)
}
ptrT data( mir_utf8decodeT(url.c_str()));
- CallService(MS_UTILS_OPENURL, (WPARAM)OUF_TCHAR, (LPARAM)data);
+
+ // Check if there is user defined browser for opening links
+ ptrT browser(getTStringA(FACEBOOK_KEY_OPEN_URL_BROWSER));
+ if (browser != NULL)
+ // If so, use it to open this link
+ ForkThread(&FacebookProto::OpenUrlThread, new open_url(browser, data));
+ else
+ // Or use Miranda's service
+ CallService(MS_UTILS_OPENURL, (WPARAM)OUF_TCHAR, (LPARAM)data);
}
void FacebookProto::ReadNotificationWorker(void *p)