Bladeren bron

added API to change chat subject

dev1
isymchych 9 jaren geleden
bovenliggende
commit
cbb46c63cd
6 gewijzigde bestanden met toevoegingen van 237 en 378 verwijderingen
  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 Bestand weergeven

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
  * Adds JitsiLocalTrack object to the conference.
274
  * Adds JitsiLocalTrack object to the conference.
265
  * @param track the JitsiLocalTrack object.
275
  * @param track the JitsiLocalTrack object.
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
     conference.room.addListener(XMPPEvents.MUC_JOINED, function () {
804
     conference.room.addListener(XMPPEvents.MUC_JOINED, function () {
791
         conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_JOINED);
805
         conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_JOINED);
792
     });
806
     });

+ 4
- 0
JitsiConferenceEvents.js Bestand weergeven

39
      * A user has changed it display name
39
      * A user has changed it display name
40
      */
40
      */
41
     DISPLAY_NAME_CHANGED: "conference.displayNameChanged",
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
      * A participant avatar has changed.
47
      * A participant avatar has changed.
44
      */
48
      */

+ 5
- 3
doc/API.md Bestand weergeven

83
         - USER_LEFT - a participant left conference. (parameters - id(string), user(JitsiParticipant))
83
         - USER_LEFT - a participant left conference. (parameters - id(string), user(JitsiParticipant))
84
         - MESSAGE_RECEIVED - new text message received. (parameters - id(string), text(string), ts(number))
84
         - MESSAGE_RECEIVED - new text message received. (parameters - id(string), text(string), ts(number))
85
         - DISPLAY_NAME_CHANGED - user has changed his display name. (parameters - id(string), displayName(string))
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
         - LAST_N_ENDPOINTS_CHANGED - last n set was changed (parameters - array of ids of users)
87
         - LAST_N_ENDPOINTS_CHANGED - last n set was changed (parameters - array of ids of users)
87
         - 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
         - 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
         - CONFERENCE_JOINED - notifies the local user that he joined the conference successfully. (no parameters)
89
         - CONFERENCE_JOINED - notifies the local user that he joined the conference successfully. (no parameters)
283
 
284
 
284
 28. isStartVideoMuted() - check if video is muted on join
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
 JitsiTrack
292
 JitsiTrack
291
 ======
293
 ======

+ 198
- 358
lib-jitsi-meet.js
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 16
- 16
lib-jitsi-meet.min.js
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 0
- 1
modules/xmpp/ChatRoom.js Bestand weergeven

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

Laden…
Annuleren
Opslaan