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

Method setGroupCall

Telegram/SourceFiles/data/data_chat.cpp:215–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215void ChatData::setGroupCall(
216 const MTPInputGroupCall &call,
217 TimeId scheduleDate,
218 bool rtmp) {
219 if (migrateTo()) {
220 return;
221 }
222 call.match([&](const MTPDinputGroupCall &data) {
223 if (_call && _call->id() == data.vid().v) {
224 return;
225 } else if (!_call && !data.vid().v) {
226 return;
227 } else if (!data.vid().v) {
228 clearGroupCall();
229 return;
230 }
231 const auto hasCall = (_call != nullptr);
232 if (hasCall) {
233 owner().unregisterGroupCall(_call.get());
234 }
235 _call = std::make_unique<Data::GroupCall>(
236 this,
237 data.vid().v,
238 data.vaccess_hash().v,
239 scheduleDate,
240 rtmp,
241 Data::GroupCallOrigin::Group);
242 owner().registerGroupCall(_call.get());
243 session().changes().peerUpdated(this, UpdateFlag::GroupCall);
244 addFlags(Flag::CallActive);
245 }, [&](const auto &) {
246 clearGroupCall();
247 });
248}
249
250void ChatData::clearGroupCall() {
251 if (!_call) {

Callers 3

ApplyChatUpdateFunction · 0.45
applyServiceChangesMethod · 0.45

Calls 6

unregisterGroupCallMethod · 0.80
registerGroupCallMethod · 0.80
peerUpdatedMethod · 0.80
idMethod · 0.45
getMethod · 0.45
changesMethod · 0.45

Tested by

no test coverage detected