diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp index 9b0747870e..385cb1ac6f 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_permissions_box.cpp @@ -104,7 +104,7 @@ constexpr auto kForceDisableTooltipDuration = 3 * crl::time(1000); using Flag = ChatAdminRight; if (options.isGroup) { - auto result = std::vector{ + auto first = std::vector{ { Flag::ChangeInfo, tr::lng_rights_group_info(tr::now) }, { Flag::DeleteMessages, tr::lng_rights_group_delete(tr::now) }, { Flag::BanUsers, tr::lng_rights_group_ban(tr::now) }, @@ -113,19 +113,30 @@ constexpr auto kForceDisableTooltipDuration = 3 * crl::time(1000); : tr::lng_rights_group_invite(tr::now) }, { Flag::ManageTopics, tr::lng_rights_group_topics(tr::now) }, { Flag::PinMessages, tr::lng_rights_group_pin(tr::now) }, + }; + auto stories = std::vector{ + { Flag::PostStories, tr::lng_rights_channel_post_stories(tr::now) }, + { Flag::EditStories, tr::lng_rights_channel_edit_stories(tr::now) }, + { Flag::DeleteStories, tr::lng_rights_channel_delete_stories(tr::now) }, + }; + auto second = std::vector{ { Flag::ManageCall, tr::lng_rights_group_manage_calls(tr::now) }, { Flag::Anonymous, tr::lng_rights_group_anonymous(tr::now) }, { Flag::AddAdmins, tr::lng_rights_add_admins(tr::now) }, }; if (!options.isForum) { - result.erase( + first.erase( ranges::remove( - result, + first, Flag::ManageTopics | Flag(), &AdminRightLabel::flags), - end(result)); + end(first)); } - return { { std::nullopt, std::move(result) } }; + return { + { std::nullopt, std::move(first) }, + { tr::lng_rights_channel_manage_stories(), std::move(stories) }, + { std::nullopt, std::move(second) }, + }; } auto first = std::vector{ { Flag::ChangeInfo, tr::lng_rights_channel_info(tr::now) }, diff --git a/Telegram/SourceFiles/data/data_channel.cpp b/Telegram/SourceFiles/data/data_channel.cpp index 87d2a53018..469351af25 100644 --- a/Telegram/SourceFiles/data/data_channel.cpp +++ b/Telegram/SourceFiles/data/data_channel.cpp @@ -556,25 +556,16 @@ bool ChannelData::canDeleteMessages() const { } bool ChannelData::canPostStories() const { - if (!isBroadcast()) { - return false; - } return amCreator() || (adminRights() & AdminRight::PostStories); } bool ChannelData::canEditStories() const { - if (!isBroadcast()) { - return false; - } return amCreator() || (adminRights() & AdminRight::EditStories); } bool ChannelData::canDeleteStories() const { - if (!isBroadcast()) { - return false; - } return amCreator() || (adminRights() & AdminRight::DeleteStories); } diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index b7955f4ba7..b85703cf09 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -355,6 +355,7 @@ HistoryInner::HistoryInner( _theme = std::move(theme); controller->setChatStyleTheme(_theme); }, lifetime()); + Assert(_theme != nullptr); setAttribute(Qt::WA_AcceptTouchEvents);