mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Fix processing requests from search results.
This commit is contained in:
parent
8618f6d7eb
commit
721aac57a5
1 changed files with 8 additions and 3 deletions
|
@ -366,12 +366,18 @@ void RequestsBoxController::rowElementClicked(
|
|||
void RequestsBoxController::processRequest(
|
||||
not_null<UserData*> user,
|
||||
bool approved) {
|
||||
const auto done = crl::guard(this, [=] {
|
||||
const auto remove = [=] {
|
||||
if (const auto row = delegate()->peerListFindRow(user->id.value)) {
|
||||
delegate()->peerListRemoveRow(row);
|
||||
refreshDescription();
|
||||
delegate()->peerListRefreshRows();
|
||||
}
|
||||
static_cast<RequestsBoxSearchController*>(
|
||||
searchController())->removeFromCache(user);
|
||||
pushRecentRequests();
|
||||
};
|
||||
const auto done = crl::guard(this, [=] {
|
||||
remove();
|
||||
if (approved) {
|
||||
Ui::ShowMultilineToast({
|
||||
.text = (_peer->isBroadcast()
|
||||
|
@ -383,9 +389,8 @@ void RequestsBoxController::processRequest(
|
|||
Ui::Text::WithEntities)
|
||||
});
|
||||
}
|
||||
pushRecentRequests();
|
||||
});
|
||||
const auto fail = [] {};
|
||||
const auto fail = crl::guard(this, remove);
|
||||
session().api().inviteLinks().processRequest(
|
||||
_peer,
|
||||
QString(), // link
|
||||
|
|
Loading…
Add table
Reference in a new issue