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

Support joining to voice chats as a channel.

This commit is contained in:
John Preston
2021-03-05 12:14:34 +04:00
parent 02517f7221
commit 02e9b8fd18
18 changed files with 391 additions and 26 deletions

View File

@@ -713,6 +713,14 @@ void ChannelData::clearGroupCall() {
| MTPDchannel::Flag::f_call_not_empty);
}
void ChannelData::setGroupCallDefaultJoinAs(PeerId peerId) {
_callDefaultJoinAs = peerId;
}
PeerId ChannelData::groupCallDefaultJoinAs() const {
return _callDefaultJoinAs;
}
namespace Data {
void ApplyMigration(
@@ -759,6 +767,11 @@ void ApplyChannelUpdate(
} else {
channel->clearGroupCall();
}
if (const auto as = update.vgroupcall_default_join_as()) {
channel->setGroupCallDefaultJoinAs(peerFromMTP(*as));
} else {
channel->setGroupCallDefaultJoinAs(0);
}
channel->setMessagesTTL(update.vttl_period().value_or_empty());
channel->setFullFlags(update.vflags().v);