mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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(
|
void RequestsBoxController::processRequest(
|
||||||
not_null<UserData*> user,
|
not_null<UserData*> user,
|
||||||
bool approved) {
|
bool approved) {
|
||||||
const auto done = crl::guard(this, [=] {
|
const auto remove = [=] {
|
||||||
if (const auto row = delegate()->peerListFindRow(user->id.value)) {
|
if (const auto row = delegate()->peerListFindRow(user->id.value)) {
|
||||||
delegate()->peerListRemoveRow(row);
|
delegate()->peerListRemoveRow(row);
|
||||||
refreshDescription();
|
refreshDescription();
|
||||||
delegate()->peerListRefreshRows();
|
delegate()->peerListRefreshRows();
|
||||||
}
|
}
|
||||||
|
static_cast<RequestsBoxSearchController*>(
|
||||||
|
searchController())->removeFromCache(user);
|
||||||
|
pushRecentRequests();
|
||||||
|
};
|
||||||
|
const auto done = crl::guard(this, [=] {
|
||||||
|
remove();
|
||||||
if (approved) {
|
if (approved) {
|
||||||
Ui::ShowMultilineToast({
|
Ui::ShowMultilineToast({
|
||||||
.text = (_peer->isBroadcast()
|
.text = (_peer->isBroadcast()
|
||||||
|
@ -383,9 +389,8 @@ void RequestsBoxController::processRequest(
|
||||||
Ui::Text::WithEntities)
|
Ui::Text::WithEntities)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
pushRecentRequests();
|
|
||||||
});
|
});
|
||||||
const auto fail = [] {};
|
const auto fail = crl::guard(this, remove);
|
||||||
session().api().inviteLinks().processRequest(
|
session().api().inviteLinks().processRequest(
|
||||||
_peer,
|
_peer,
|
||||||
QString(), // link
|
QString(), // link
|
||||||
|
|
Loading…
Add table
Reference in a new issue