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

Apply group call updates.

This commit is contained in:
John Preston
2020-11-24 14:56:46 +03:00
parent 33941ad1b9
commit 25f3c14780
9 changed files with 357 additions and 61 deletions

View File

@@ -38,6 +38,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h" // tr::lng_deleted(tr::now) in user name
#include "data/stickers/data_stickers.h"
#include "data/data_changes.h"
#include "data/data_group_call.h"
#include "data/data_media_types.h"
#include "data/data_folder.h"
#include "data/data_channel.h"
@@ -791,6 +792,19 @@ void Session::applyMaximumChatVersions(const MTPVector<MTPChat> &data) {
}
}
void Session::registerGroupCall(not_null<GroupCall*> call) {
_groupCalls.emplace(call->id(), call);
}
void Session::unregisterGroupCall(not_null<GroupCall*> call) {
_groupCalls.remove(call->id());
}
GroupCall *Session::groupCall(uint64 callId) const {
const auto i = _groupCalls.find(callId);
return (i != end(_groupCalls)) ? i->second.get() : nullptr;
}
PeerData *Session::peerByUsername(const QString &username) const {
const auto uname = username.trimmed();
for (const auto &[peerId, peer] : _peers) {