2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +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

@@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h"
#include "data/data_changes.h"
#include "data/stickers/data_stickers.h"
#include "data/stickers/data_custom_emoji.h" // AllowEmojiWithoutPremium.
#include "lang/lang_keys.h"
#include "mainwindow.h"
#include "apiwrap.h"
@@ -839,6 +840,8 @@ void TabbedSelector::setCurrentPeer(PeerData *peer) {
if (hasStickersTab()) {
stickers()->showMegagroupSet(peer ? peer->asMegagroup() : nullptr);
}
setAllowEmojiWithoutPremium(
peer && Data::AllowEmojiWithoutPremium(peer));
}
void TabbedSelector::checkRestrictedPeer() {
@@ -924,6 +927,15 @@ void TabbedSelector::setRoundRadius(int radius) {
}
}
void TabbedSelector::setAllowEmojiWithoutPremium(bool allow) {
for (const auto &tab : _tabs) {
if (tab.type() == SelectorTab::Emoji) {
const auto emoji = static_cast<EmojiListWidget*>(tab.widget());
emoji->setAllowWithoutPremium(allow);
}
}
}
void TabbedSelector::createTabsSlider() {
_tabsSlider.create(this, st::emojiTabs);