diff options
author | George Hazan <ghazan@miranda.im> | 2020-01-05 19:12:57 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-01-05 19:12:57 +0300 |
commit | 79db2025e68ad0639ad5842365048512963b63f8 (patch) | |
tree | d41a5e9129f8f5a40b1ccfbf707a041ef1ada74e /protocols | |
parent | 8456233ba760bd0f18cd62b2ba8e9eef3a642aee (diff) |
slightly modified link processor
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Facebook/src/server.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp index bfd50e5f1c..8a0369014b 100644 --- a/protocols/Facebook/src/server.cpp +++ b/protocols/Facebook/src/server.cpp @@ -525,9 +525,24 @@ void FacebookProto::OnPublishPrivateMessage(const JSONNode &root) continue; const JSONNode &attach = (*nBody).at((json_index_t)0)["story_attachment"]; - szBody += "\r\n-----------------------------------\r\n"; + szBody += "\r\n-----------------------------------"; + + CMStringA str = attach["url"].as_mstring(); + if (!str.IsEmpty()) { + if (str.Left(8) == "fbrpc") { + int iStart = str.Find("target_url="); + if (iStart != 0) { + int iEnd = str.Find("&", iStart + 11); + if (iEnd == -1) + szBody.AppendFormat("\r\n\t%s: %s", TranslateU("URL"), str.c_str() + iStart); + else + szBody.AppendFormat("\r\n\t%s: %s", TranslateU("URL"), str.Mid(iStart, iEnd).c_str()); + } + } + else szBody.AppendFormat("\r\n\t%s: %s", TranslateU("URL"), str.c_str()); + } - CMStringA str = attach["title"].as_mstring(); + str = attach["title"].as_mstring(); if (!str.IsEmpty()) szBody.AppendFormat("\r\n\t%s: %s", TranslateU("Title"), str.c_str()); |