mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-27 16:02:00 +00:00
Fix build with Xcode.
This commit is contained in:
@@ -2727,9 +2727,9 @@ void StickersListWidget::removeMegagroupSet(bool locally) {
|
||||
}
|
||||
close();
|
||||
}),
|
||||
.cancelled = crl::guard(this, [this](Fn<void()> &&close) {
|
||||
.cancelled = [](Fn<void()> &&close) {
|
||||
close();
|
||||
}),
|
||||
},
|
||||
})));
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ struct RecentEmojiDocument {
|
||||
struct RecentEmojiId {
|
||||
std::variant<EmojiPtr, RecentEmojiDocument> data;
|
||||
|
||||
friend inline auto operator<=>(
|
||||
friend inline bool operator==(
|
||||
RecentEmojiId,
|
||||
RecentEmojiId) = default;
|
||||
};
|
||||
|
||||
@@ -258,13 +258,25 @@ void AppendFavedStickers(
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] EmojiPack RecentEmojiSection() {
|
||||
const auto list = Core::App().settings().recentEmoji();
|
||||
auto result = EmojiPack();
|
||||
result.reserve(list.size());
|
||||
for (const auto &emoji : list) {
|
||||
if (const auto one = std::get_if<EmojiPtr>(&emoji.id.data)) {
|
||||
result.push_back(*one);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void AppendEmojiPacks(
|
||||
const Data::StickersSets &sets,
|
||||
std::vector<PickerScrubberItem> &to) {
|
||||
for (auto i = 0; i != ChatHelpers::kEmojiSectionCount; ++i) {
|
||||
const auto section = static_cast<Ui::Emoji::Section>(i);
|
||||
const auto list = (section == Ui::Emoji::Section::Recent)
|
||||
? Core::App().settings().recentEmojiSection()
|
||||
? RecentEmojiSection()
|
||||
: Ui::Emoji::GetSection(section);
|
||||
const auto title = (section == Ui::Emoji::Section::Recent)
|
||||
? TitleRecentlyUsed(sets)
|
||||
@@ -475,7 +487,7 @@ void AppendEmojiPacks(
|
||||
if (const auto inputField = qobject_cast<QTextEdit*>(
|
||||
QApplication::focusWidget())) {
|
||||
Ui::InsertEmojiAtCursor(inputField->textCursor(), emoji);
|
||||
Core::App().settings().incrementRecentEmoji(emoji);
|
||||
Core::App().settings().incrementRecentEmoji({ emoji });
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user