From 62c842df372abe0349f025ac4cbbc8426526ac8b Mon Sep 17 00:00:00 2001 From: ikeblaster Date: Tue, 7 Jan 2020 13:46:01 +0100 Subject: Facebook: differentiate image and file inline attachment --- protocols/Facebook/src/server.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'protocols/Facebook/src') diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp index 1bd0062b1a..a355423a3f 100644 --- a/protocols/Facebook/src/server.cpp +++ b/protocols/Facebook/src/server.cpp @@ -533,9 +533,16 @@ void FacebookProto::OnPublishPrivateMessage(const JSONNode &root) JsonReply reply(ExecuteRequest(pReq)); if (!reply.error()) { - CMStringA str = reply.data()["redirect_uri"].as_mstring(); - if (!str.IsEmpty()) - szBody.AppendFormat("\r\nPicture attachment: %s", str.c_str()); + CMStringA uri = reply.data()["redirect_uri"].as_mstring(); + CMStringA type = reply.data()["content_type"].as_mstring(); + if (!uri.IsEmpty()) { + if (type.Find("image/") == 0) + szBody.Append("\r\nPicture attachment: "); + else + szBody.Append("\r\nFile attachment: "); + + szBody.Append(uri); + } } continue; } -- cgit v1.2.3