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

Replace TLHelp helpers with .match()

This commit is contained in:
John Preston
2019-01-10 15:15:13 +04:00
parent 9a60e744d3
commit dba9ca2084
9 changed files with 42 additions and 102 deletions

View File

@@ -17,7 +17,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/peers/manage_peer_box.h"
#include "boxes/peers/edit_peer_info_box.h"
#include "ui/toast/toast.h"
#include "core/tl_help.h"
#include "auth_session.h"
#include "apiwrap.h"
#include "mainwidget.h"
@@ -698,14 +697,16 @@ void PeerMenuAddChannelMembers(not_null<ChannelData*> channel) {
LayerOption::KeepOther);
return;
}
auto callback = [channel](const MTPchannels_ChannelParticipants &result) {
auto callback = [=](const MTPchannels_ChannelParticipants &result) {
Auth().api().parseChannelParticipants(channel, result, [&](
int availableCount,
const QVector<MTPChannelParticipant> &list) {
auto already = (
list
) | ranges::view::transform([&](auto &&p) {
return TLHelp::ReadChannelParticipantUserId(p);
) | ranges::view::transform([](const MTPChannelParticipant &p) {
return p.match([](const auto &data) {
return data.vuser_id.v;
});
}) | ranges::view::transform([](UserId userId) {
return App::userLoaded(userId);
}) | ranges::view::filter([](UserData *user) {