mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Remove confirmation when sharing a user to a bot.
This commit is contained in:
parent
bfd318cf3f
commit
9e79b59cce
1 changed files with 8 additions and 4 deletions
|
@ -204,8 +204,7 @@ object_ptr<Ui::BoxContent> MakeConfirmBox(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
RequestPeerQuery query,
|
RequestPeerQuery query,
|
||||||
Fn<void()> confirmed) {
|
Fn<void()> confirmed) {
|
||||||
const auto user = peer->asUser();
|
const auto name = peer->name();
|
||||||
const auto name = user ? user->firstName : peer->name();
|
|
||||||
const auto botName = bot->name();
|
const auto botName = bot->name();
|
||||||
auto text = tr::lng_request_peer_confirm(
|
auto text = tr::lng_request_peer_confirm(
|
||||||
tr::now,
|
tr::now,
|
||||||
|
@ -214,7 +213,7 @@ object_ptr<Ui::BoxContent> MakeConfirmBox(
|
||||||
lt_bot,
|
lt_bot,
|
||||||
Ui::Text::Bold(botName),
|
Ui::Text::Bold(botName),
|
||||||
Ui::Text::WithEntities);
|
Ui::Text::WithEntities);
|
||||||
if (!user) {
|
if (!peer->isUser()) {
|
||||||
const auto rights = peer->isBroadcast()
|
const auto rights = peer->isBroadcast()
|
||||||
? BroadcastRightsText(query.botRights)
|
? BroadcastRightsText(query.botRights)
|
||||||
: GroupRightsText(query.botRights);
|
: GroupRightsText(query.botRights);
|
||||||
|
@ -431,7 +430,12 @@ void ChoosePeerBoxController::rowClicked(not_null<PeerListRow*> row) {
|
||||||
const auto onstack = callback;
|
const auto onstack = callback;
|
||||||
onstack(peer);
|
onstack(peer);
|
||||||
};
|
};
|
||||||
delegate()->peerListShowBox(MakeConfirmBox(_bot, peer, _query, done));
|
if (const auto user = peer->asUser()) {
|
||||||
|
done();
|
||||||
|
} else {
|
||||||
|
delegate()->peerListShowBox(
|
||||||
|
MakeConfirmBox(_bot, peer, _query, done));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ChoosePeerBoxController::createRow(not_null<History*> history)
|
auto ChoosePeerBoxController::createRow(not_null<History*> history)
|
||||||
|
|
Loading…
Add table
Reference in a new issue