From be7d4d020bd9713a92e17bf268fc0e382815763a Mon Sep 17 00:00:00 2001
From: David Baker <dave@matrix.org>
Date: Tue, 27 Apr 2021 19:33:53 +0100
Subject: [PATCH] Put asserted identity option under a 'voip' section

---
 src/CallHandler.tsx      | 4 +++-
 test/CallHandler-test.ts | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx
index f2a2e71854..16bc837aa2 100644
--- a/src/CallHandler.tsx
+++ b/src/CallHandler.tsx
@@ -188,7 +188,9 @@ export default class CallHandler {
     public roomIdForCall(call: MatrixCall): string {
         if (!call) return null;
 
-        if (SdkConfig.get()['voipObeyAssertedIdentity']) {
+        const voipConfig = SdkConfig.get()['voip'];
+
+        if (voipConfig && voipConfig.obeyAssertedIdentity) {
             const nativeUser = this.assertedIdentityNativeUsers[call.callId];
             if (nativeUser) {
                 const room = findDMForUser(MatrixClientPeg.get(), nativeUser);
diff --git a/test/CallHandler-test.ts b/test/CallHandler-test.ts
index cb801b4936..754610b223 100644
--- a/test/CallHandler-test.ts
+++ b/test/CallHandler-test.ts
@@ -189,7 +189,9 @@ describe('CallHandler', () => {
 
         // Now set the config option
         SdkConfig.put({
-            voipObeyAssertedIdentity: true,
+            voip: {
+                obeyAssertedIdentity: true,
+            },
         });
 
         // ...and send another asserted identity event for a different user