2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Add to Group / Channel with suggested rights for bots.

This commit is contained in:
John Preston
2022-03-23 14:15:52 +04:00
parent b62c7c76c8
commit a35888a07b
8 changed files with 141 additions and 22 deletions

View File

@@ -617,17 +617,19 @@ void Filler::addEditContact() {
void Filler::addBotToGroup() {
const auto user = _peer->asUser();
if (!user
|| !user->isBot()
|| user->isRepliesChat()
|| user->botInfo->cantJoinGroups) {
if (!user) {
return;
}
using AddBotToGroup = AddBotToGroupBoxController;
_addAction(
tr::lng_profile_invite_to_group(tr::now),
[=] { AddBotToGroup::Start(user); },
&st::menuIconInvite);
[[maybe_unused]] const auto lifetime = Info::Profile::InviteToChatButton(
user
) | rpl::take(1) | rpl::start_with_next([=](QString label) {
if (!label.isEmpty()) {
_addAction(
label,
[=] { AddBotToGroupBoxController::Start(user); },
&st::menuIconInvite);
}
});
}
void Filler::addNewMembers() {