diff options
author | George Hazan <ghazan@miranda.im> | 2017-02-15 20:22:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-02-15 20:22:29 +0300 |
commit | ad212509efd1de495c7a4ad08504bc062bfe8e2a (patch) | |
tree | 47cbe3a37747cf2dd107878ff85082d368d7521b /protocols/Discord/src/utils.cpp | |
parent | acd9edbd6413e9ff25378bd4e2cbc515d2a620f7 (diff) |
Discord: groupchat history support
version bump
Diffstat (limited to 'protocols/Discord/src/utils.cpp')
-rw-r--r-- | protocols/Discord/src/utils.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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; } |