2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Insert / Copy emoji from pack preview.

This commit is contained in:
John Preston
2022-09-14 14:45:23 +04:00
parent cae18b3320
commit bc340d75c4
23 changed files with 282 additions and 215 deletions

View File

@@ -492,21 +492,16 @@ bool TabbedSelector::hasMasksTab() const {
return _hasMasksTab;
}
auto TabbedSelector::emojiChosen() const -> rpl::producer<EmojiChosen> {
rpl::producer<EmojiChosen> TabbedSelector::emojiChosen() const {
return emoji()->chosen();
}
auto TabbedSelector::customEmojiChosen() const -> rpl::producer<FileChosen> {
rpl::producer<FileChosen> TabbedSelector::customEmojiChosen() const {
return emoji()->customChosen();
}
auto TabbedSelector::premiumEmojiChosen() const
-> rpl::producer<FileChosen> {
return emoji()->premiumChosen();
}
auto TabbedSelector::fileChosen() const -> rpl::producer<FileChosen> {
auto never = rpl::never<TabbedSelector::FileChosen>(
rpl::producer<FileChosen> TabbedSelector::fileChosen() const {
auto never = rpl::never<FileChosen>(
) | rpl::type_erased();
return rpl::merge(
hasStickersTab() ? stickers()->chosen() : never,
@@ -514,8 +509,7 @@ auto TabbedSelector::fileChosen() const -> rpl::producer<FileChosen> {
hasMasksTab() ? masks()->chosen() : never);
}
auto TabbedSelector::photoChosen() const
-> rpl::producer<TabbedSelector::PhotoChosen>{
rpl::producer<PhotoChosen> TabbedSelector::photoChosen() const {
return hasGifsTab() ? gifs()->photoChosen() : nullptr;
}
@@ -865,13 +859,6 @@ void TabbedSelector::setCurrentPeer(PeerData *peer) {
peer && Data::AllowEmojiWithoutPremium(peer));
}
void TabbedSelector::showPromoForPremiumEmoji() {
premiumEmojiChosen(
) | rpl::start_with_next([=] {
ShowPremiumPreviewBox(_controller, PremiumPreview::AnimatedEmoji);
}, lifetime());
}
void TabbedSelector::provideRecentEmoji(
const std::vector<DocumentId> &customRecentList) {
for (const auto &tab : _tabs) {