瀏覽代碼

feat(JitsiParticipant): expose bot type.

release-8443
hristoterezov 7 年之前
父節點
當前提交
0838bfd1d4
共有 3 個檔案被更改,包括 20 行新增0 行删除
  1. 6
    0
      JitsiConference.js
  2. 5
    0
      JitsiConferenceEvents.js
  3. 9
    0
      JitsiParticipant.js

+ 6
- 0
JitsiConference.js 查看文件

1228
 
1228
 
1229
     if (botParticipant) {
1229
     if (botParticipant) {
1230
         botParticipant._botType = botType;
1230
         botParticipant._botType = botType;
1231
+        const id = Strophe.getResourceFromJid(jid);
1232
+
1233
+        this.eventEmitter.emit(
1234
+            JitsiConferenceEvents.BOT_TYPE_CHANGED,
1235
+            id,
1236
+            botType);
1231
     }
1237
     }
1232
 
1238
 
1233
     // if botType changed to undefined, botType was removed, in case of
1239
     // if botType changed to undefined, botType was removed, in case of

+ 5
- 0
JitsiConferenceEvents.js 查看文件

284
  * User status changed.
284
  * User status changed.
285
  */
285
  */
286
 export const USER_STATUS_CHANGED = 'conference.statusChanged';
286
 export const USER_STATUS_CHANGED = 'conference.statusChanged';
287
+
288
+/**
289
+ * Event indicates that the bot participant type cahnged.
290
+ */
291
+export const BOT_TYPE_CHANGED = 'conference.bot_type_changed';

+ 9
- 0
JitsiParticipant.js 查看文件

244
     getFeatures(timeout = 5000) {
244
     getFeatures(timeout = 5000) {
245
         return this._conference.xmpp.caps.getFeatures(this._jid, timeout);
245
         return this._conference.xmpp.caps.getFeatures(this._jid, timeout);
246
     }
246
     }
247
+
248
+    /**
249
+     * Returns the bot type for the participant.
250
+     *
251
+     * @returns {string|undefined} - The bot type of the participant.
252
+     */
253
+    getBotType() {
254
+        return this._botType;
255
+    }
247
 }
256
 }

Loading…
取消
儲存