|
@@ -127,18 +127,14 @@ class API {
|
127
|
127
|
}
|
128
|
128
|
|
129
|
129
|
/**
|
130
|
|
- * Sends message to the external application.
|
|
130
|
+ * Sends event to the external application.
|
131
|
131
|
*
|
132
|
|
- * @param {string} name - The name of the event.
|
133
|
|
- * @param {Object} data - The data to be sent.
|
|
132
|
+ * @param {Object} event - The event to be sent.
|
134
|
133
|
* @returns {void}
|
135
|
134
|
*/
|
136
|
|
- _sendEvent(name, data = {}) {
|
|
135
|
+ _sendEvent(event = {}) {
|
137
|
136
|
if (this._enabled) {
|
138
|
|
- transport.sendEvent({
|
139
|
|
- data,
|
140
|
|
- name
|
141
|
|
- });
|
|
137
|
+ transport.sendEvent(event);
|
142
|
138
|
}
|
143
|
139
|
}
|
144
|
140
|
|
|
@@ -149,7 +145,10 @@ class API {
|
149
|
145
|
* @returns {void}
|
150
|
146
|
*/
|
151
|
147
|
notifySendingChatMessage(message) {
|
152
|
|
- this._sendEvent('outgoing-message', { message });
|
|
148
|
+ this._sendEvent({
|
|
149
|
+ name: 'outgoing-message',
|
|
150
|
+ message
|
|
151
|
+ });
|
153
|
152
|
}
|
154
|
153
|
|
155
|
154
|
/**
|
|
@@ -164,7 +163,8 @@ class API {
|
164
|
163
|
return;
|
165
|
164
|
}
|
166
|
165
|
|
167
|
|
- this._sendEvent('incoming-message', {
|
|
166
|
+ this._sendEvent({
|
|
167
|
+ name: 'incoming-message',
|
168
|
168
|
from: id,
|
169
|
169
|
message: body,
|
170
|
170
|
nick,
|
|
@@ -180,7 +180,10 @@ class API {
|
180
|
180
|
* @returns {void}
|
181
|
181
|
*/
|
182
|
182
|
notifyUserJoined(id) {
|
183
|
|
- this._sendEvent('participant-joined', { id });
|
|
183
|
+ this._sendEvent({
|
|
184
|
+ name: 'participant-joined',
|
|
185
|
+ id
|
|
186
|
+ });
|
184
|
187
|
}
|
185
|
188
|
|
186
|
189
|
/**
|
|
@@ -191,7 +194,10 @@ class API {
|
191
|
194
|
* @returns {void}
|
192
|
195
|
*/
|
193
|
196
|
notifyUserLeft(id) {
|
194
|
|
- this._sendEvent('participant-left', { id });
|
|
197
|
+ this._sendEvent({
|
|
198
|
+ name: 'participant-left',
|
|
199
|
+ id
|
|
200
|
+ });
|
195
|
201
|
}
|
196
|
202
|
|
197
|
203
|
/**
|
|
@@ -203,7 +209,7 @@ class API {
|
203
|
209
|
* @returns {void}
|
204
|
210
|
*/
|
205
|
211
|
notifyDisplayNameChanged(id, displayname) {
|
206
|
|
- this._sendEvent('display-name-change', {
|
|
212
|
+ this._sendEvent({ name: 'display-name-change',
|
207
|
213
|
displayname,
|
208
|
214
|
id
|
209
|
215
|
});
|
|
@@ -217,7 +223,10 @@ class API {
|
217
|
223
|
* @returns {void}
|
218
|
224
|
*/
|
219
|
225
|
notifyConferenceJoined(roomName) {
|
220
|
|
- this._sendEvent('video-conference-joined', { roomName });
|
|
226
|
+ this._sendEvent({
|
|
227
|
+ name: 'video-conference-joined',
|
|
228
|
+ roomName
|
|
229
|
+ });
|
221
|
230
|
}
|
222
|
231
|
|
223
|
232
|
/**
|
|
@@ -228,7 +237,10 @@ class API {
|
228
|
237
|
* @returns {void}
|
229
|
238
|
*/
|
230
|
239
|
notifyConferenceLeft(roomName) {
|
231
|
|
- this._sendEvent('video-conference-left', { roomName });
|
|
240
|
+ this._sendEvent({
|
|
241
|
+ name: 'video-conference-left',
|
|
242
|
+ roomName
|
|
243
|
+ });
|
232
|
244
|
}
|
233
|
245
|
|
234
|
246
|
/**
|
|
@@ -238,7 +250,7 @@ class API {
|
238
|
250
|
* @returns {void}
|
239
|
251
|
*/
|
240
|
252
|
notifyReadyToClose() {
|
241
|
|
- this._sendEvent('video-ready-to-close', {});
|
|
253
|
+ this._sendEvent({ name: 'video-ready-to-close' });
|
242
|
254
|
}
|
243
|
255
|
|
244
|
256
|
/**
|