mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-06 11:52:58 +00:00
Add community chats directly for community admins
This commit is contained in:
@@ -2227,6 +2227,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_community_add_confirm" = "If this group is approved by a community admin, its members will be able to join or request to join other chats in the community.";
|
||||
"lng_community_add_confirm_add" = "Add";
|
||||
"lng_community_add_done" = "Group added to the community.";
|
||||
"lng_community_add_done_channel" = "Channel added to the community.";
|
||||
"lng_community_request_sent" = "Your request was sent to the community admins.";
|
||||
"lng_community_manage_name" = "Community name";
|
||||
"lng_community_manage_who_add" = "Who can add chats";
|
||||
|
||||
@@ -245,7 +245,9 @@ void ShowAddPeerToCommunity(
|
||||
visible,
|
||||
[=] {
|
||||
show->hideLayer();
|
||||
show->showToast(tr::lng_community_add_done(tr::now));
|
||||
show->showToast(group->isBroadcast()
|
||||
? tr::lng_community_add_done_channel(tr::now)
|
||||
: tr::lng_community_add_done(tr::now));
|
||||
},
|
||||
[=](const QString &error) {
|
||||
if (error == Api::kCommunityRequestCreated.utf16()) {
|
||||
@@ -264,12 +266,18 @@ void ShowAddPeerToCommunity(
|
||||
}
|
||||
});
|
||||
};
|
||||
show->showBox(Ui::MakeConfirmBox({
|
||||
.text = tr::lng_community_add_confirm(),
|
||||
.confirmed = sure,
|
||||
.confirmText = tr::lng_community_add_confirm_add(),
|
||||
.title = tr::lng_community_add_to(),
|
||||
}));
|
||||
// A community admin adds chats directly; everyone else can only
|
||||
// suggest a chat, which a community admin must then approve.
|
||||
if (community->canManageLinkedPeers()) {
|
||||
sure([] {});
|
||||
} else {
|
||||
show->showBox(Ui::MakeConfirmBox({
|
||||
.text = tr::lng_community_add_confirm(),
|
||||
.confirmed = sure,
|
||||
.confirmText = tr::lng_community_add_confirm_add(),
|
||||
.title = tr::lng_community_add_to(),
|
||||
}));
|
||||
}
|
||||
};
|
||||
show->showBox(Box(ChooseVisibilityBox, add));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user