瀏覽代碼

added API to change chat subject

dev1
isymchych 9 年之前
父節點
當前提交
cbb46c63cd
共有 6 個檔案被更改,包括 237 行新增378 行删除
  1. 14
    0
      JitsiConference.js
  2. 4
    0
      JitsiConferenceEvents.js
  3. 5
    3
      doc/API.md
  4. 198
    358
      lib-jitsi-meet.js
  5. 16
    16
      lib-jitsi-meet.min.js
  6. 0
    1
      modules/xmpp/ChatRoom.js

+ 14
- 0
JitsiConference.js 查看文件

@@ -260,6 +260,16 @@ JitsiConference.prototype.setDisplayName = function(name) {
260 260
     }
261 261
 };
262 262
 
263
+/**
264
+ * Set new subject for this conference. (available only for moderator)
265
+ * @param {string} subject new subject
266
+ */
267
+JitsiConference.prototype.setSubject = function (subject) {
268
+    if (this.room && this.isModerator()) {
269
+        this.room.setSubject(subject);
270
+    }
271
+};
272
+
263 273
 /**
264 274
  * Adds JitsiLocalTrack object to the conference.
265 275
  * @param track the JitsiLocalTrack object.
@@ -787,6 +797,10 @@ function setupListeners(conference) {
787 797
         }
788 798
     );
789 799
 
800
+    conference.room.addListener(XMPPEvents.SUBJECT_CHANGED, function (subject) {
801
+        conference.eventEmitter.emit(JitsiConferenceEvents.SUBJECT_CHANGED, subject);
802
+    });
803
+
790 804
     conference.room.addListener(XMPPEvents.MUC_JOINED, function () {
791 805
         conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_JOINED);
792 806
     });

+ 4
- 0
JitsiConferenceEvents.js 查看文件

@@ -39,6 +39,10 @@ var JitsiConferenceEvents = {
39 39
      * A user has changed it display name
40 40
      */
41 41
     DISPLAY_NAME_CHANGED: "conference.displayNameChanged",
42
+    /**
43
+     * Indicates that subject of the conference has changed.
44
+     */
45
+    SUBJECT_CHANGED: "conference.subjectChanged",
42 46
     /**
43 47
      * A participant avatar has changed.
44 48
      */

+ 5
- 3
doc/API.md 查看文件

@@ -83,6 +83,7 @@ JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
83 83
         - USER_LEFT - a participant left conference. (parameters - id(string), user(JitsiParticipant))
84 84
         - MESSAGE_RECEIVED - new text message received. (parameters - id(string), text(string), ts(number))
85 85
         - DISPLAY_NAME_CHANGED - user has changed his display name. (parameters - id(string), displayName(string))
86
+        - SUBJECT_CHANGED - notifies that subject of the conference has changed (parameters - subject(string))
86 87
         - LAST_N_ENDPOINTS_CHANGED - last n set was changed (parameters - array of ids of users)
87 88
         - IN_LAST_N_CHANGED - passes boolean property that shows whether the local user is included in last n set of any other user or not. (parameters - boolean)
88 89
         - CONFERENCE_JOINED - notifies the local user that he joined the conference successfully. (no parameters)
@@ -283,9 +284,10 @@ The object represents a conference. We have the following methods to control the
283 284
 
284 285
 28. isStartVideoMuted() - check if video is muted on join
285 286
 
286
-29. sendFeedback(overallFeedback, detailedFeedback) - Sends the given feedback through CallStats if enabled.
287
-    - overallFeedback an integer between 1 and 5 indicating the user feedback
288
-    - detailedFeedback detailed feedback from the user. Not yet used
287
+29. setSubject(subject) - change subject of the conference
288
+    - subject - string new subject
289
+
290
+    Note: available only for moderator
289 291
 
290 292
 JitsiTrack
291 293
 ======

+ 198
- 358
lib-jitsi-meet.js
文件差異過大導致無法顯示
查看文件


+ 16
- 16
lib-jitsi-meet.min.js
文件差異過大導致無法顯示
查看文件


+ 0
- 1
modules/xmpp/ChatRoom.js 查看文件

@@ -366,7 +366,6 @@ ChatRoom.prototype.setSubject = function (subject) {
366 366
     var msg = $msg({to: this.roomjid, type: 'groupchat'});
367 367
     msg.c('subject', subject);
368 368
     this.connection.send(msg);
369
-    logger.log("topic changed to " + subject);
370 369
 };
371 370
 
372 371
 

Loading…
取消
儲存