Ver código fonte

ref: Simplifies with a helper variable.

dev1
Boris Grozev 7 anos atrás
pai
commit
942a5c377a
1 arquivos alterados com 16 adições e 15 exclusões
  1. 16
    15
      modules/xmpp/moderator.js

+ 16
- 15
modules/xmpp/moderator.js Ver arquivo

@@ -147,6 +147,7 @@ Moderator.prototype.createConferenceIq = function() {
147 147
     // Session Id used for authentication
148 148
     const { sessionId } = Settings;
149 149
     const machineUID = Settings.machineId;
150
+    const config = this.options.conference;
150 151
 
151 152
     logger.info(`Session ID: ${sessionId} machine UID: ${machineUID}`);
152 153
 
@@ -176,38 +177,38 @@ Moderator.prototype.createConferenceIq = function() {
176 177
                 value: this.options.connection.hosts.call_control
177 178
             }).up();
178 179
     }
179
-    if (this.options.conference.channelLastN !== undefined) {
180
+    if (config.channelLastN !== undefined) {
180 181
         elem.c(
181 182
             'property', {
182 183
                 name: 'channelLastN',
183
-                value: this.options.conference.channelLastN
184
+                value: config.channelLastN
184 185
             }).up();
185 186
     }
186 187
     elem.c(
187 188
         'property', {
188 189
             name: 'disableRtx',
189
-            value: Boolean(this.options.conference.disableRtx)
190
+            value: Boolean(config.disableRtx)
190 191
         }).up();
191 192
 
192
-    if (this.options.conference.enableTcc !== undefined) {
193
+    if (config.enableTcc !== undefined) {
193 194
         elem.c(
194 195
                 'property', {
195 196
                     name: 'enableTcc',
196
-                    value: Boolean(this.options.conference.enableTcc)
197
+                    value: Boolean(config.enableTcc)
197 198
                 }).up();
198 199
     }
199
-    if (this.options.conference.enableRemb !== undefined) {
200
+    if (config.enableRemb !== undefined) {
200 201
         elem.c(
201 202
                 'property', {
202 203
                     name: 'enableRemb',
203
-                    value: Boolean(this.options.conference.enableRemb)
204
+                    value: Boolean(config.enableRemb)
204 205
                 }).up();
205 206
     }
206
-    if (this.options.conference.minParticipants !== undefined) {
207
+    if (config.minParticipants !== undefined) {
207 208
         elem.c(
208 209
                 'property', {
209 210
                     name: 'minParticipants',
210
-                    value: this.options.conference.minParticipants
211
+                    value: config.minParticipants
211 212
                 }).up();
212 213
     }
213 214
 
@@ -216,25 +217,25 @@ Moderator.prototype.createConferenceIq = function() {
216 217
             name: 'enableLipSync',
217 218
             value: this.options.connection.enableLipSync !== false
218 219
         }).up();
219
-    if (this.options.conference.audioPacketDelay !== undefined) {
220
+    if (config.audioPacketDelay !== undefined) {
220 221
         elem.c(
221 222
             'property', {
222 223
                 name: 'audioPacketDelay',
223
-                value: this.options.conference.audioPacketDelay
224
+                value: config.audioPacketDelay
224 225
             }).up();
225 226
     }
226
-    if (this.options.conference.startBitrate) {
227
+    if (config.startBitrate) {
227 228
         elem.c(
228 229
             'property', {
229 230
                 name: 'startBitrate',
230
-                value: this.options.conference.startBitrate
231
+                value: config.startBitrate
231 232
             }).up();
232 233
     }
233
-    if (this.options.conference.minBitrate) {
234
+    if (config.minBitrate) {
234 235
         elem.c(
235 236
             'property', {
236 237
                 name: 'minBitrate',
237
-                value: this.options.conference.minBitrate
238
+                value: config.minBitrate
238 239
             }).up();
239 240
     }
240 241
 

Carregando…
Cancelar
Salvar