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

Allow sending premium emoji to Saved Messages.

This commit is contained in:
John Preston
2022-08-01 16:24:51 +03:00
parent 087074fea4
commit b42f2784ab
18 changed files with 93 additions and 39 deletions

View File

@@ -250,15 +250,16 @@ SendFilesBox::SendFilesBox(
not_null<Window::SessionController*> controller,
Ui::PreparedList &&list,
const TextWithTags &caption,
SendLimit limit,
not_null<PeerData*> peer,
Api::SendType sendType,
SendMenu::Type sendMenuType)
: _controller(controller)
, _sendType(sendType)
, _titleHeight(st::boxTitleHeight)
, _list(std::move(list))
, _sendLimit(limit)
, _sendLimit(peer->slowmodeApplied() ? SendLimit::One : SendLimit::Many)
, _sendMenuType(sendMenuType)
, _allowEmojiWithoutPremium(Data::AllowEmojiWithoutPremium(peer))
, _caption(
this,
st::confirmCaptionArea,
@@ -676,7 +677,8 @@ void SendFilesBox::setupCaption() {
InitMessageFieldHandlers(
_controller,
_caption.data(),
Window::GifPauseReason::Layer);
Window::GifPauseReason::Layer,
[=](const auto&) { return _allowEmojiWithoutPremium; });
Ui::Emoji::SuggestionsController::Init(
getDelegate()->outerContainer(),
_caption,
@@ -730,6 +732,8 @@ void SendFilesBox::setupEmojiPanel() {
st::emojiPanMinHeight / 2,
st::emojiPanMinHeight);
_emojiPanel->hide();
_emojiPanel->selector()->setAllowEmojiWithoutPremium(
_allowEmojiWithoutPremium);
_emojiPanel->selector()->emojiChosen(
) | rpl::start_with_next([=](EmojiPtr emoji) {
Ui::InsertEmojiAtCursor(_caption->textCursor(), emoji);