Browse Source

Add identity to JitsiParticipant

release-8443
Paul Tiedtke 6 years ago
parent
commit
1239562fb2
3 changed files with 16 additions and 2 deletions
  1. 1
    1
      JitsiConference.js
  2. 3
    1
      JitsiParticipant.js
  3. 12
    0
      doc/tokens.md

+ 1
- 1
JitsiConference.js View File

1342
     }
1342
     }
1343
 
1343
 
1344
     const participant
1344
     const participant
1345
-        = new JitsiParticipant(jid, this, nick, isHidden, statsID, status);
1345
+        = new JitsiParticipant(jid, this, nick, isHidden, statsID, status, identity);
1346
 
1346
 
1347
     participant._role = role;
1347
     participant._role = role;
1348
     participant._botType = botType;
1348
     participant._botType = botType;

+ 3
- 1
JitsiParticipant.js View File

28
      * represent a hidden participant; otherwise, false.
28
      * represent a hidden participant; otherwise, false.
29
      * @param {string} statsID - optional participant statsID
29
      * @param {string} statsID - optional participant statsID
30
      * @param {string} status - the initial status if any.
30
      * @param {string} status - the initial status if any.
31
+     * @param {object} identity - the xmpp identity
31
      */
32
      */
32
-    constructor(jid, conference, displayName, hidden, statsID, status) {
33
+    constructor(jid, conference, displayName, hidden, statsID, status, identity) {
33
         this._jid = jid;
34
         this._jid = jid;
34
         this._id = Strophe.getResourceFromJid(jid);
35
         this._id = Strophe.getResourceFromJid(jid);
35
         this._conference = conference;
36
         this._conference = conference;
42
         this._statsID = statsID;
43
         this._statsID = statsID;
43
         this._connectionStatus = ParticipantConnectionStatus.ACTIVE;
44
         this._connectionStatus = ParticipantConnectionStatus.ACTIVE;
44
         this._properties = {};
45
         this._properties = {};
46
+        this._identity = identity;
45
     }
47
     }
46
 
48
 
47
     /* eslint-enable max-params */
49
     /* eslint-enable max-params */

+ 12
- 0
doc/tokens.md View File

38
   - 'name' is the display name of the 'callee' user
38
   - 'name' is the display name of the 'callee' user
39
   - 'avatar' is the URL of the avatar of the 'callee'
39
   - 'avatar' is the URL of the avatar of the 'callee'
40
 
40
 
41
+#### Access token identifiers / context
42
+To access the data in lib-jitsi-meet you have to enable the prosody module `mod_presence_identity` in your config.
43
+
44
+```lua
45
+VirtualHost "jitmeet.example.com"
46
+    modules_enabled = { "presence_identity" }
47
+```
48
+
49
+The data is now available as the identity in the JitsiParticipant class. You can access them by e.g. listening to the `USER_JOINED` event.
50
+
51
+NOTE: The values in the token shall always be valid values. If you define e.g. the avatar as `null` it will throw an error.
52
+
41
 ### Example Token
53
 ### Example Token
42
 #### Headers (using RS256 public key validation)
54
 #### Headers (using RS256 public key validation)
43
 ```
55
 ```

Loading…
Cancel
Save