Updates for beta10

This commit is contained in:
WolverinDEV
2020-02-15 14:03:46 +01:00
parent 423f7a7303
commit 035f23ef23
19 changed files with 242 additions and 218 deletions
+4 -7
View File
@@ -87,7 +87,6 @@ void ConnectedClient::updateChannelClientProperties(bool lock_channel_tree, bool
auto permissions = this->calculate_permissions({
permission::i_client_talk_power,
permission::b_client_is_priority_speaker,
permission::b_client_ignore_antiflood,
permission::i_channel_view_power,
permission::b_channel_ignore_view_power
@@ -95,15 +94,12 @@ void ConnectedClient::updateChannelClientProperties(bool lock_channel_tree, bool
permission::v2::PermissionFlaggedValue
permission_talk_power{0, false},
permission_priority_speaker{0, false},
permission_ignore_antiflood{0, false},
permission_channel_view_power{0, false},
permission_channel_ignore_view_power{0, false};
for(const auto& perm : permissions) {
if(perm.first == permission::i_client_talk_power)
permission_talk_power = perm.second;
else if(perm.first == permission::b_client_is_priority_speaker)
permission_priority_speaker = perm.second;
else if(perm.first == permission::b_client_ignore_antiflood)
permission_ignore_antiflood = perm.second;
else if(perm.first == permission::i_channel_view_power)
@@ -161,9 +157,10 @@ void ConnectedClient::updateChannelClientProperties(bool lock_channel_tree, bool
}
}
auto pSpeaker = permission_priority_speaker.has_value && permission_priority_speaker.value > 0;
if(properties()[property::CLIENT_IS_PRIORITY_SPEAKER].as<bool>() != pSpeaker){
properties()[property::CLIENT_IS_PRIORITY_SPEAKER] = pSpeaker;
auto pSpeaker = this->clientPermissions ? this->clientPermissions->channel_permission(permission::b_client_is_priority_speaker, this->getChannelId()) : permission::v2::empty_channel_permission;
auto pSpeakerGranted = permission::v2::permission_granted(1, {pSpeaker.values.value, pSpeaker.flags.value_set});
if(properties()[property::CLIENT_IS_PRIORITY_SPEAKER].as<bool>() != pSpeakerGranted){
properties()[property::CLIENT_IS_PRIORITY_SPEAKER] = pSpeakerGranted;
notifyList.emplace_back(property::CLIENT_IS_PRIORITY_SPEAKER);
}