2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Fix custom emoji in initial send files caption.

This commit is contained in:
John Preston
2022-08-15 19:10:38 +03:00
parent 888306c017
commit 7c2d3a8855
2 changed files with 12 additions and 6 deletions

View File

@@ -260,12 +260,8 @@ SendFilesBox::SendFilesBox(
, _sendLimit(peer->slowmodeApplied() ? SendLimit::One : SendLimit::Many)
, _sendMenuType(sendMenuType)
, _allowEmojiWithoutPremium(Data::AllowEmojiWithoutPremium(peer))
, _caption(
this,
st::confirmCaptionArea,
Ui::InputField::Mode::MultiLine,
nullptr,
caption)
, _caption(this, st::confirmCaptionArea, Ui::InputField::Mode::MultiLine)
, _prefilledCaptionText(std::move(caption))
, _scroll(this, st::boxScroll)
, _inner(
_scroll->setOwnedWidget(
@@ -688,6 +684,15 @@ void SendFilesBox::setupCaption() {
&_controller->session(),
{ .suggestCustomEmoji = true, .allowCustomWithoutPremium = allow });
if (!_prefilledCaptionText.text.isEmpty()) {
_caption->setTextWithTags(
_prefilledCaptionText,
Ui::InputField::HistoryAction::Clear);
auto cursor = _caption->textCursor();
cursor.movePosition(QTextCursor::End);
_caption->setTextCursor(cursor);
}
_caption->setSubmitSettings(
Core::App().settings().sendSubmitWay());
_caption->setMaxLength(kMaxMessageLength);