@@ -24,7 +24,7 @@ class Application implements EntityInterface, \JsonSerializable, JsonUnserializa
2424 protected $ voiceConfig ;
2525 protected $ messagesConfig ;
2626 protected $ rtcConfig ;
27- protected $ usesVbc = false ; // This will become a config if we ever have parameters
27+ protected $ vbcConfig ;
2828
2929 protected $ name ;
3030
@@ -42,18 +42,6 @@ public function getId()
4242 return $ this ->id ;
4343 }
4444
45- public function enableVbc () {
46- $ this ->usesVbc = true ;
47- }
48-
49- public function disableVbc () {
50- $ this ->usesVbc = false ;
51- }
52-
53- public function isVbcEnabled () {
54- return $ this ->usesVbc ;
55- }
56-
5745 public function setVoiceConfig (VoiceConfig $ config )
5846 {
5947 $ this ->voiceConfig = $ config ;
@@ -72,6 +60,12 @@ public function setRtcConfig(RtcConfig $config)
7260 return $ this ;
7361 }
7462
63+ public function setVbcConfig (VbcConfig $ config )
64+ {
65+ $ this ->vbcConfig = $ config ;
66+ return $ this ;
67+ }
68+
7569 /**
7670 * @return VoiceConfig
7771 */
@@ -126,6 +120,18 @@ public function getRtcConfig()
126120 return $ this ->rtcConfig ;
127121 }
128122
123+ /**
124+ * @return RtcConfig
125+ */
126+ public function getVbcConfig ()
127+ {
128+ if (!isset ($ this ->vbcConfig )){
129+ $ this ->setVbcConfig (new VbcConfig ());
130+ }
131+
132+ return $ this ->vbcConfig ;
133+ }
134+
129135 public function setPublicKey ($ key )
130136 {
131137 $ this ->keys ['public_key ' ] = $ key ;
@@ -191,7 +197,7 @@ public function jsonUnserialize(array $json)
191197 }
192198
193199 if (isset ($ capabilities ['vbc ' ])) {
194- $ this ->enableVbc ();
200+ $ this ->getVbcConfig ()-> enable ();
195201 }
196202 }
197203 }
@@ -224,7 +230,7 @@ public function jsonSerialize()
224230 }
225231
226232 // Handle VBC specifically
227- if ($ this ->usesVbc ) {
233+ if ($ this ->vbcConfig -> isEnabled () ) {
228234 $ capabilities ['vbc ' ] = new \StdClass ;
229235 }
230236
0 commit comments