diff options
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r-- | protocols/FacebookRM/src/chat.cpp | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 9 | ||||
-rw-r--r-- | protocols/FacebookRM/src/proto.h | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 618b86f85e..b1c32e0ce2 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -428,7 +428,7 @@ void FacebookProto::UpdateNotificationsChatRoom(facebook_notification *notificat return;
std::stringstream text;
- text << notification->text << "\n\n" << notification->link;
+ text << notification->text << "\n\n" << PrepareUrl(notification->link);
std::string smessage = text.str();
utils::text::replace_all(&smessage, "%", "%%");
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 9cd807d96c..463b7c1e89 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -817,8 +817,7 @@ void FacebookProto::OpenUrlThread(void *p) { delete data; } -void FacebookProto::OpenUrl(std::string url) -{ +std::string FacebookProto::PrepareUrl(std::string url) { std::string::size_type pos = url.find(FACEBOOK_SERVER_DOMAIN); bool isFacebookUrl = (pos != std::string::npos); bool isRelativeUrl = (url.substr(0, 4) != "http"); @@ -840,6 +839,12 @@ void FacebookProto::OpenUrl(std::string url) url = (useHttps ? HTTP_PROTO_SECURE : HTTP_PROTO_REGULAR) + facy.get_server_type() + url; } + return url; +} + +void FacebookProto::OpenUrl(std::string url) +{ + url = PrepareUrl(url); ptrT data( mir_utf8decodeT(url.c_str())); // Check if there is user defined browser for opening links diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index fc869b581c..8f85582ca6 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -237,6 +237,7 @@ public: void ToggleStatusMenuItems(BOOL bEnable); void StickerAsSmiley(std::string stickerId, const std::string &url, MCONTACT hContact); void SaveName(MCONTACT hContact, const facebook_user *fbu); + std::string PrepareUrl(std::string url); void OpenUrl(std::string url); void __cdecl OpenUrlThread(void*); void MessageRead(MCONTACT hContact); |