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

Replace base::lambda with shorter term.

base::lambda -> Fn (type alias for std::function).
base::lambda_once -> FnMut (type alias for base::unique_function).
base::lambda_guarded -> crl::guard.
base::lambda_call_type_t -> crl::deduced_call_type.
This commit is contained in:
John Preston
2018-06-04 18:35:11 +03:00
parent 8d1cdea31a
commit dd81f5d59f
216 changed files with 792 additions and 1455 deletions

View File

@@ -244,20 +244,20 @@ Ui::PopupMenu *GroupMembersWidget::fillPeerMenu(PeerData *selectedPeer) {
if (channel) {
if (channel->canEditAdmin(user)) {
auto label = lang((item->adminState != Item::AdminState::None) ? lng_context_edit_permissions : lng_context_promote_admin);
result->addAction(label, base::lambda_guarded(this, [this, user] {
result->addAction(label, crl::guard(this, [this, user] {
editAdmin(user);
}));
}
if (channel->canRestrictUser(user)) {
result->addAction(lang(lng_context_restrict_user), base::lambda_guarded(this, [this, user] {
result->addAction(lang(lng_context_restrict_user), crl::guard(this, [this, user] {
restrictUser(user);
}));
result->addAction(lang(lng_context_remove_from_group), base::lambda_guarded(this, [this, selectedPeer] {
result->addAction(lang(lng_context_remove_from_group), crl::guard(this, [this, selectedPeer] {
removePeer(selectedPeer);
}));
}
} else if (item->hasRemoveLink) {
result->addAction(lang(lng_context_remove_from_group), base::lambda_guarded(this, [this, selectedPeer] {
result->addAction(lang(lng_context_remove_from_group), crl::guard(this, [this, selectedPeer] {
removePeer(selectedPeer);
}));
}