From ad212509efd1de495c7a4ad08504bc062bfe8e2a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 15 Feb 2017 20:22:29 +0300 Subject: Discord: groupchat history support version bump --- protocols/Discord/src/utils.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'protocols/Discord/src/utils.cpp') diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp index 4666ab188f..40911369d2 100644 --- a/protocols/Discord/src/utils.cpp +++ b/protocols/Discord/src/utils.cpp @@ -238,6 +238,28 @@ CMStringW PrepareMessageText(const JSONNode &pRoot) } } + const JSONNode &pEmbeds = pRoot["embeds"]; + for (auto it = pEmbeds.begin(); it != pEmbeds.end(); ++it) { + const JSONNode &p = *it; + + wszText.Append(L"\n-----------------"); + + CMStringW str = p["url"].as_mstring(); + wszText.AppendFormat(L"\n%s: %s", TranslateT("Embed"), str); + + str = p["provider"]["name"].as_mstring() + L" " + p["type"].as_mstring(); + if (str.GetLength() > 1) + wszText.AppendFormat(L"\n\t%s", str); + + str = p["description"].as_mstring(); + if (!str.IsEmpty()) + wszText.AppendFormat(L"\n\t%s", str); + + str = p["thumbnail"]["url"].as_mstring(); + if (!str.IsEmpty()) + wszText.AppendFormat(L"\n%s: %s", TranslateT("Preview"), str); + } + return wszText; } -- cgit v1.2.3