diff options
author | George Hazan <ghazan@miranda.im> | 2020-01-10 20:52:55 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-01-10 20:52:55 +0300 |
commit | cb462baced051c43598acf767058514a9aefd73c (patch) | |
tree | e4c192cd50d3ab3deab838db7fe1b732b098c1e5 | |
parent | 476ff2be86850722a70b262557bb2bae699a3c89 (diff) |
Facebook: fix for correct fbrpc:// processing
-rw-r--r-- | protocols/Facebook/src/server.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp index 780e81104d..2b47f373ef 100644 --- a/protocols/Facebook/src/server.cpp +++ b/protocols/Facebook/src/server.cpp @@ -562,14 +562,20 @@ void FacebookProto::OnPublishPrivateMessage(const JSONNode &root) CMStringA str = attach["url"].as_mstring(); if (!str.IsEmpty()) { - if (str.Left(8) == "fbrpc") { + 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); + CMStringA tmp; + + iStart += 11; + int iEnd = str.Find("&", iStart); + if (iEnd != -1) + tmp = str.Mid(iStart, iEnd - iStart); else - szBody.AppendFormat("\r\n\t%s: %s", TranslateU("URL"), str.Mid(iStart, iEnd).c_str()); + tmp = str.Right(iStart); + + mir_urlDecode(tmp.GetBuffer()); + szBody.AppendFormat("\r\n\t%s: %s", TranslateU("URL"), tmp.c_str()); } } else szBody.AppendFormat("\r\n\t%s: %s", TranslateU("URL"), str.c_str()); |