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

Moved code for api participants to separated file.

This commit is contained in:
23rd
2021-11-24 07:25:05 +03:00
committed by John Preston
parent 3271cdf251
commit b9c64499bd
24 changed files with 840 additions and 730 deletions

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "calls/group/calls_group_invite_controller.h"
#include "api/api_chat_participants.h"
#include "calls/group/calls_group_call.h"
#include "calls/group/calls_group_menu.h"
#include "boxes/peer_lists_box.h"
@@ -221,7 +222,7 @@ object_ptr<Ui::BoxContent> PrepareInviteBox(
const std::vector<not_null<UserData*>> &users,
const std::vector<not_null<UserData*>> &nonMembers,
Fn<void()> finish) {
peer->session().api().addChatParticipants(
peer->session().api().chatParticipants().add(
peer,
nonMembers,
[=](bool) { invite(users); finish(); });

View File

@@ -49,7 +49,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/unixtime.h"
#include "base/qt_signal_producer.h"
#include "base/timer_rpl.h"
#include "apiwrap.h" // api().kickParticipant.
#include "apiwrap.h" // api().kick.
#include "api/api_chat_participants.h" // api().kick.
#include "webrtc/webrtc_video_track.h"
#include "webrtc/webrtc_media_devices.h" // UniqueDesktopCaptureSource.
#include "webrtc/webrtc_audio_input_tester.h"
@@ -1344,7 +1345,7 @@ void Panel::showBox(
void Panel::kickParticipantSure(not_null<PeerData*> participantPeer) {
if (const auto chat = _peer->asChat()) {
chat->session().api().kickParticipant(chat, participantPeer);
chat->session().api().chatParticipants().kick(chat, participantPeer);
} else if (const auto channel = _peer->asChannel()) {
const auto currentRestrictedRights = [&] {
const auto user = participantPeer->asUser();
@@ -1356,7 +1357,7 @@ void Panel::kickParticipantSure(not_null<PeerData*> participantPeer) {
? i->second.rights
: ChatRestrictionsInfo();
}();
channel->session().api().kickParticipant(
channel->session().api().chatParticipants().kick(
channel,
participantPeer,
currentRestrictedRights);