Support disabling messages in conferences.

This commit is contained in:
John Preston
2025-09-30 17:22:24 +04:00
parent 93b2a52f34
commit 86d1ab00e0
7 changed files with 58 additions and 23 deletions
+15 -4
View File
@@ -501,6 +501,7 @@ void GroupCall::applyCallFields(const MTPDgroupCall &data) {
"Set from groupCall %1 -> %2"
).arg(_version
).arg(data.vversion().v));
const auto initial = !_version;
_version = data.vversion().v;
if (!_version) {
LOG(("API Error: Got zero version in groupCall."));
@@ -509,8 +510,20 @@ void GroupCall::applyCallFields(const MTPDgroupCall &data) {
_rtmp = data.is_rtmp_stream();
_creator = data.is_creator();
_listenersHidden = data.is_listeners_hidden();
_joinMuted = data.is_join_muted();
_canChangeJoinMuted = data.is_can_change_join_muted();
if (data.is_conference()) {
_canChangeJoinMuted = false;
_joinMuted = false;
const auto enabled = data.is_messages_enabled();
_canChangeMessagesEnabled = enabled;
if (!enabled || initial) {
_messagesEnabled = enabled;
}
} else {
_canChangeJoinMuted = data.is_can_change_join_muted();
_joinMuted = data.is_join_muted();
_canChangeMessagesEnabled = data.is_can_change_messages_enabled();
_messagesEnabled = data.is_messages_enabled();
}
_joinedToTop = !data.is_join_date_asc();
setServerParticipantsCount(data.vparticipants_count().v);
changePeerEmptyCallFlag();
@@ -522,8 +535,6 @@ void GroupCall::applyCallFields(const MTPDgroupCall &data) {
_scheduleDate = data.vschedule_date().value_or_empty();
_scheduleStartSubscribed = data.is_schedule_start_subscribed();
_unmutedVideoLimit = data.vunmuted_video_limit().v;
_messagesEnabled = data.is_messages_enabled();
_canChangeMessagesEnabled = data.is_can_change_messages_enabled();
_allParticipantsLoaded
= (_serverParticipantsCount == _participants.size());
_conferenceInviteLink = qs(data.vinvite_link().value_or_empty());