Fix to check value for "recording"

with this fix it's also not necessary to check for HPB in the app. The "recording" value from capabilities is set accordingly on server side.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2023-01-31 14:26:37 +01:00
parent fba04620e1
commit 401bb6e2cf
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
2 changed files with 7 additions and 4 deletions

View file

@ -2969,8 +2969,7 @@ public class CallActivity extends CallBaseActivity {
}
public boolean isAllowedToStartOrStopRecording() {
return CapabilitiesUtilNew.hasSpreedFeatureCapability(conversationUser, "recording-v1") &&
CapabilitiesUtilNew.isCallRecordingAvailable(conversationUser)
return CapabilitiesUtilNew.isCallRecordingAvailable(conversationUser)
&& isModerator;
}

View file

@ -100,9 +100,13 @@ object CapabilitiesUtilNew {
@JvmStatic
fun isCallRecordingAvailable(user: User): Boolean {
if (user.capabilities?.spreedCapability?.config?.containsKey("call") == true) {
if (hasSpreedFeatureCapability(user, "recording-v1") &&
user.capabilities?.spreedCapability?.config?.containsKey("call") == true
) {
val map: Map<String, String>? = user.capabilities!!.spreedCapability!!.config!!["call"]
return map != null && map.containsKey("recording")
if (map != null && map.containsKey("recording")) {
return map["recording"].toBoolean()
}
}
return false
}