MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / GroupCall

Method GroupCall

Telegram/SourceFiles/data/data_group_call.cpp:61–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61GroupCall::GroupCall(
62 not_null<PeerData*> peer,
63 CallId id,
64 uint64 accessHash,
65 TimeId scheduleDate,
66 bool rtmp,
67 GroupCallOrigin origin)
68: _id(id)
69, _accessHash(accessHash)
70, _peer(peer)
71, _reloadByQueuedUpdatesTimer([=] { reload(); })
72, _speakingByActiveFinishTimer([=] { checkFinishSpeakingByActive(); })
73, _scheduleDate(scheduleDate)
74, _savedSendAs(peer->session().user())
75, _rtmp(rtmp)
76, _conference(origin == GroupCallOrigin::Conference)
77, _videoStream(origin == GroupCallOrigin::VideoStream)
78, _listenersHidden(rtmp) {
79 if (_conference) {
80 session().data().registerGroupCall(this);
81
82 _participantUpdates.events(
83 ) | rpl::filter([=](const ParticipantUpdate &update) {
84 return !update.now
85 && !update.was->peer->isSelf()
86 && !_participantsWithAccess.current().empty();
87 }) | rpl::on_next([=](const ParticipantUpdate &update) {
88 if (const auto id = peerToUser(update.was->peer->id)) {
89 if (_participantsWithAccess.current().contains(id)) {
90 _staleParticipantIds.fire({ id });
91 }
92 }
93 }, _checkStaleLifetime);
94
95 _participantsWithAccess.changes(
96 ) | rpl::filter([=](const base::flat_set<UserId> &list) {
97 return !list.empty();
98 }) | rpl::on_next([=] {
99 if (_allParticipantsLoaded) {
100 checkStaleParticipants();
101 } else {
102 requestParticipants();
103 }
104 }, _checkStaleLifetime);
105 } else if (_videoStream) {
106 session().data().registerGroupCall(this);
107 }
108}
109
110GroupCall::~GroupCall() {
111 if (_conference || _videoStream) {

Callers

nothing calls this directly

Calls 12

peerToUserFunction · 0.85
registerGroupCallMethod · 0.80
isSelfMethod · 0.80
userMethod · 0.45
sessionMethod · 0.45
dataMethod · 0.45
eventsMethod · 0.45
emptyMethod · 0.45
currentMethod · 0.45
containsMethod · 0.45
fireMethod · 0.45
changesMethod · 0.45

Tested by

no test coverage detected