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

@@ -58,7 +58,7 @@ Inner::Inner(QWidget *parent, not_null<Window::Controller*> controller) : TWidge
update();
}
});
subscribe(Notify::PeerUpdated(), Notify::PeerUpdatedHandler(Notify::PeerUpdate::Flag::ChannelRightsChanged, [this](const Notify::PeerUpdate &update) {
subscribe(Notify::PeerUpdated(), Notify::PeerUpdatedHandler(Notify::PeerUpdate::Flag::RightsChanged, [this](const Notify::PeerUpdate &update) {
if (update.peer == _inlineQueryPeer) {
auto isRestricted = (_restrictedLabel != nullptr);
if (isRestricted != isRestrictedView()) {
@@ -80,8 +80,8 @@ void Inner::visibleTopBottomUpdated(
}
void Inner::checkRestrictedPeer() {
if (auto megagroup = _inlineQueryPeer ? _inlineQueryPeer->asMegagroup() : nullptr) {
if (megagroup->restricted(ChatRestriction::f_send_inline)) {
if (_inlineQueryPeer) {
if (_inlineQueryPeer->amRestricted(ChatRestriction::f_send_inline)) {
if (!_restrictedLabel) {
_restrictedLabel.create(this, lang(lng_restricted_send_inline), Ui::FlatLabel::InitType::Simple, st::stickersRestrictedLabel);
_restrictedLabel->show();