2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +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

@@ -237,6 +237,14 @@ void ChatData::clearGroupCall() {
| MTPDchat::Flag::f_call_not_empty);
}
void ChatData::setGroupCallDefaultJoinAs(PeerId peerId) {
_callDefaultJoinAs = peerId;
}
PeerId ChatData::groupCallDefaultJoinAs() const {
return _callDefaultJoinAs;
}
namespace Data {
void ApplyChatUpdate(
@@ -376,6 +384,11 @@ void ApplyChatUpdate(not_null<ChatData*> chat, const MTPDchatFull &update) {
} else {
chat->clearGroupCall();
}
if (const auto as = update.vgroupcall_default_join_as()) {
chat->setGroupCallDefaultJoinAs(peerFromMTP(*as));
} else {
chat->setGroupCallDefaultJoinAs(0);
}
chat->setMessagesTTL(update.vttl_period().value_or_empty());
if (const auto info = update.vbot_info()) {