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

Edit admin and restricted rights in channels.

This commit is contained in:
John Preston
2017-06-09 18:12:02 +02:00
parent 513a9f8d45
commit 7d2d5c6100
26 changed files with 1138 additions and 590 deletions

View File

@@ -1226,7 +1226,7 @@ void MainWidget::clearHistory(PeerData *peer) {
MTP::send(MTPmessages_DeleteHistory(MTP_flags(flags), peer->input, MTP_int(0)), rpcDone(&MainWidget::deleteHistoryPart, request));
}
void MainWidget::addParticipants(PeerData *chatOrChannel, const QVector<UserData*> &users) {
void MainWidget::addParticipants(PeerData *chatOrChannel, const std::vector<gsl::not_null<UserData*>> &users) {
if (chatOrChannel->isChat()) {
auto chat = chatOrChannel->asChat();
for_const (auto user, users) {
@@ -1234,8 +1234,8 @@ void MainWidget::addParticipants(PeerData *chatOrChannel, const QVector<UserData
}
} else if (chatOrChannel->isChannel()) {
QVector<MTPInputUser> inputUsers;
inputUsers.reserve(qMin(users.size(), int(MaxUsersPerInvite)));
for (QVector<UserData*>::const_iterator i = users.cbegin(), e = users.cend(); i != e; ++i) {
inputUsers.reserve(qMin(int(users.size()), int(MaxUsersPerInvite)));
for (auto i = users.cbegin(), e = users.cend(); i != e; ++i) {
inputUsers.push_back((*i)->inputUser);
if (inputUsers.size() == MaxUsersPerInvite) {
MTP::send(MTPchannels_InviteToChannel(chatOrChannel->asChannel()->inputChannel, MTP_vector<MTPInputUser>(inputUsers)), rpcDone(&MainWidget::inviteToChannelDone, chatOrChannel->asChannel()), rpcFail(&MainWidget::addParticipantsFail, chatOrChannel->asChannel()), 0, 5);