2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Support custom emoji in chats list entries.

This commit is contained in:
John Preston
2022-07-04 10:14:24 +04:00
parent ee8d8171f7
commit b976aa0872
5 changed files with 29 additions and 5 deletions

View File

@@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/text/text_utilities.h"
#include "ui/unread_badge.h"
#include "ui/ui_utility.h"
#include "core/ui_integration.h"
#include "lang/lang_keys.h"
#include "support/support_helper.h"
#include "main/main_session.h"
@@ -455,6 +456,7 @@ void paintRow(
if (!ShowSendActionInDialogs(history)
|| !history->sendActionPainter()->paint(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
if (history->cloudDraftTextCache.isEmpty()) {
using namespace TextUtilities;
auto draftWrapped = Text::PlainLink(
tr::lng_dialogs_text_from_wrapped(
tr::now,
@@ -468,12 +470,23 @@ void paintRow(
lt_from_part,
draftWrapped,
lt_message,
{ .text = draft->textWithTags.text },
{
.text = draft->textWithTags.text,
.entities = ConvertTextTagsToEntities(
draft->textWithTags.tags),
},
Text::WithEntities);
const auto context = Core::MarkedTextContext{
.session = &history->session(),
.customEmojiRepaint = [=] {
history->updateChatListEntry();
},
};
history->cloudDraftTextCache.setMarkedText(
st::dialogsTextStyle,
draftText,
DialogTextOptions());
DialogTextOptions(),
context);
}
p.setPen(active ? st::dialogsTextFgActive : (selected ? st::dialogsTextFgOver : st::dialogsTextFg));
if (supportMode) {