2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Allow reusing permissions edit controls.

This commit is contained in:
John Preston
2019-01-07 16:55:49 +04:00
parent 61419b57c8
commit f4d52b82b4
21 changed files with 1027 additions and 713 deletions

View File

@@ -357,11 +357,13 @@ void Filler::addUserActions(not_null<UserData*> user) {
void Filler::addChatActions(not_null<ChatData*> chat) {
if (_source != PeerMenuSource::ChatsList) {
// #TODO groups
if (chat->canEditInformation()) {
_addAction(
lang(lng_manage_group_title),
[chat] { Ui::show(Box<EditPeerInfoBox>(chat)); });
if (ManagePeerBox::Available(chat)) {
const auto text = lang(lng_manage_group_title);
_addAction(text, [=] {
Ui::show(Box<ManagePeerBox>(chat));
});
}
if (chat->canAddMembers()) {
_addAction(
lang(lng_profile_add_participant),
[chat] { AddChatMembers(chat); });
@@ -396,7 +398,7 @@ void Filler::addChannelActions(not_null<ChannelData*> channel) {
}
if (_source != PeerMenuSource::ChatsList) {
if (ManagePeerBox::Available(channel)) {
auto text = lang(isGroup
const auto text = lang(isGroup
? lng_manage_group_title
: lng_manage_channel_title);
_addAction(text, [channel] {