diff options
author | ikeblaster <ike@thez.info> | 2020-01-07 13:46:01 +0100 |
---|---|---|
committer | ikeblaster <ike@thez.info> | 2020-01-07 13:46:01 +0100 |
commit | 62c842df372abe0349f025ac4cbbc8426526ac8b (patch) | |
tree | 7addbfb58fb3555c4f290ecfead42d89ac299728 | |
parent | 66416c081f0c5e8323689c93648494c666f076de (diff) |
Facebook: differentiate image and file inline attachment
-rw-r--r-- | protocols/Facebook/src/server.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
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; } |