Browse Source

Simlifies code.

dev1
Boris Grozev 9 years ago
parent
commit
1f0e71a842
1 changed files with 21 additions and 18 deletions
  1. 21
    18
      modules/xmpp/moderator.js

+ 21
- 18
modules/xmpp/moderator.js View File

@@ -109,6 +109,7 @@ Moderator.prototype.createConferenceIq =  function () {
109 109
     // Session Id used for authentication
110 110
     var sessionId = this.settings.getSessionId();
111 111
     var machineUID = this.settings.getUserId();
112
+    var options = this.xmppService.options;
112 113
 
113 114
     logger.info(
114 115
             "Session ID: " + sessionId + " machine UID: " + machineUID);
@@ -122,72 +123,74 @@ Moderator.prototype.createConferenceIq =  function () {
122 123
     if (sessionId) {
123 124
         elem.attrs({ 'session-id': sessionId});
124 125
     }
125
-    if (this.xmppService.options.hosts.bridge !== undefined) {
126
+    if (options.hosts !== undefined && options.hosts.bridge !== undefined) {
126 127
         elem.c(
127 128
             'property', {
128 129
                 name: 'bridge',
129
-                value: this.xmppService.options.hosts.bridge
130
+                value: options.hosts.bridge
130 131
             }).up();
131 132
     }
132
-    if (this.xmppService.options.enforcedBridge !== undefined) {
133
+    if (options.enforcedBridge !== undefined) {
133 134
         elem.c(
134 135
             'property', {
135 136
                 name: 'enforcedBridge',
136
-                value: this.xmppService.options.enforcedBridge
137
+                value: options.enforcedBridge
137 138
             }).up();
138 139
     }
139 140
     // Tell the focus we have Jigasi configured
140
-    if (this.xmppService.options.hosts.call_control !== undefined) {
141
+    if (options.hosts !== undefined &&
142
+        options.hosts.call_control !== undefined) {
141 143
         elem.c(
142 144
             'property', {
143 145
                 name: 'call_control',
144
-                value:  this.xmppService.options.hosts.call_control
146
+                value: options.hosts.call_control
145 147
             }).up();
146 148
     }
147
-    if (this.xmppService.options.channelLastN !== undefined) {
149
+    if (options.channelLastN !== undefined) {
148 150
         elem.c(
149 151
             'property', {
150 152
                 name: 'channelLastN',
151
-                value: this.xmppService.options.channelLastN
153
+                value: options.channelLastN
152 154
             }).up();
153 155
     }
154
-    if (this.xmppService.options.adaptiveLastN !== undefined) {
156
+    if (options.adaptiveLastN !== undefined) {
155 157
         elem.c(
156 158
             'property', {
157 159
                 name: 'adaptiveLastN',
158
-                value: this.xmppService.options.adaptiveLastN
160
+                value: options.adaptiveLastN
159 161
             }).up();
160 162
     }
161
-    if (this.xmppService.options.adaptiveSimulcast !== undefined) {
163
+    if (options.adaptiveSimulcast !== undefined) {
162 164
         elem.c(
163 165
             'property', {
164 166
                 name: 'adaptiveSimulcast',
165
-                value: this.xmppService.options.adaptiveSimulcast
167
+                value: options.adaptiveSimulcast
166 168
             }).up();
167 169
     }
168
-    if (this.xmppService.options.openSctp !== undefined) {
170
+    if (options.openSctp !== undefined) {
169 171
         elem.c(
170 172
             'property', {
171 173
                 name: 'openSctp',
172
-                value: this.xmppService.options.openSctp
174
+                value: options.openSctp
173 175
             }).up();
174 176
     }
175
-    if (this.xmppService.options.startAudioMuted !== undefined)
177
+    if (options.startAudioMuted !== undefined)
176 178
     {
177 179
         elem.c(
178 180
             'property', {
179 181
                 name: 'startAudioMuted',
180
-                value: this.xmppService.options.startAudioMuted
182
+                value: options.startAudioMuted
181 183
             }).up();
182 184
     }
183
-    if (this.xmppService.options.startVideoMuted !== undefined)
185
+    if (options.startVideoMuted !== undefined)
184 186
     {
185 187
         elem.c(
186 188
             'property', {
187 189
                 name: 'startVideoMuted',
188
-                value: this.xmppService.options.startVideoMuted
190
+                value: options.startVideoMuted
189 191
             }).up();
190 192
     }
193
+
191 194
     elem.c(
192 195
         'property', {
193 196
             name: 'simulcastMode',

Loading…
Cancel
Save