2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

Prepare legacy group restrictions checking.

This commit is contained in:
John Preston
2019-01-05 14:50:04 +04:00
parent 441989a8e1
commit 61419b57c8
25 changed files with 415 additions and 403 deletions

View File

@@ -352,7 +352,7 @@ TabbedSelector::TabbedSelector(
subscribe(
Notify::PeerUpdated(),
Notify::PeerUpdatedHandler(
Notify::PeerUpdate::Flag::ChannelRightsChanged,
Notify::PeerUpdate::Flag::RightsChanged,
handleUpdate));
Auth().api().stickerSetInstalled(
@@ -672,9 +672,12 @@ void TabbedSelector::setCurrentPeer(PeerData *peer) {
}
void TabbedSelector::checkRestrictedPeer() {
if (auto megagroup = _currentPeer ? _currentPeer->asMegagroup() : nullptr) {
auto restricted = (_currentTabType == SelectorTab::Stickers) ? megagroup->restricted(ChatRestriction::f_send_stickers) :
(_currentTabType == SelectorTab::Gifs) ? megagroup->restricted(ChatRestriction::f_send_gifs) : false;
if (_currentPeer) {
const auto restricted = (_currentTabType == SelectorTab::Stickers)
? _currentPeer->amRestricted(ChatRestriction::f_send_stickers)
: (_currentTabType == SelectorTab::Gifs)
? _currentPeer->amRestricted(ChatRestriction::f_send_gifs)
: false;
if (restricted) {
if (!_restrictedLabel) {
auto text = (_currentTabType == SelectorTab::Stickers)