2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 06:55:58 +00:00

Support separate message type group restrictions.

This commit is contained in:
John Preston
2023-01-10 22:56:20 +04:00
parent de5bbf2cb9
commit 554f66f089
64 changed files with 1437 additions and 832 deletions

View File

@@ -388,7 +388,9 @@ TabbedSelector::TabbedSelector(
_tabsSlider->raise();
}
if (hasStickersTab() || hasGifsTab()) {
if (hasStickersTab()
|| hasGifsTab()
|| (hasEmojiTab() && _mode == Mode::Full)) {
session().changes().peerUpdates(
Data::PeerUpdate::Flag::Rights
) | rpl::filter([=](const Data::PeerUpdate &update) {
@@ -892,6 +894,14 @@ void TabbedSelector::checkRestrictedPeer() {
? Data::RestrictionError(
_currentPeer,
ChatRestriction::SendGifs)
: (_currentTabType == SelectorTab::Emoji && _mode == Mode::Full)
? (Data::RestrictionError(
_currentPeer,
ChatRestriction::SendInline)
? Data::RestrictionError(
_currentPeer,
ChatRestriction::SendOther)
: std::nullopt)
: std::nullopt;
if (error) {
if (!_restrictedLabel) {