Added emailChange listener to API
This commit is contained in:
committed by
Hristo Terezov
parent
63c017f8e6
commit
20444adbc9
@@ -363,6 +363,24 @@ class API {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify external application (if API is enabled) that user changed their
|
||||
* email.
|
||||
*
|
||||
* @param {string} id - User id.
|
||||
* @param {string} email - The new email of the participant.
|
||||
* @returns {void}
|
||||
*/
|
||||
notifyEmailChanged(
|
||||
id: string,
|
||||
{ email }: Object) {
|
||||
this._sendEvent({
|
||||
name: 'email-change',
|
||||
email,
|
||||
id
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify external application (if API is enabled) that the conference has
|
||||
* been joined.
|
||||
|
||||
21
modules/API/external/external_api.js
vendored
21
modules/API/external/external_api.js
vendored
@@ -40,6 +40,7 @@ const events = {
|
||||
'audio-availability-changed': 'audioAvailabilityChanged',
|
||||
'audio-mute-status-changed': 'audioMuteStatusChanged',
|
||||
'display-name-change': 'displayNameChange',
|
||||
'email-change': 'emailChange',
|
||||
'feedback-submitted': 'feedbackSubmitted',
|
||||
'incoming-message': 'incomingMessage',
|
||||
'outgoing-message': 'outgoingMessage',
|
||||
@@ -398,6 +399,14 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'email-change': {
|
||||
const user = this._participants[userID];
|
||||
|
||||
if (user) {
|
||||
user.email = data.email;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'avatar-changed': {
|
||||
const user = this._participants[userID];
|
||||
|
||||
@@ -633,6 +642,18 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the email of a participant.
|
||||
*
|
||||
* @param {string} participantId - The id of the participant.
|
||||
* @returns {string} The email.
|
||||
*/
|
||||
getEmail(participantId) {
|
||||
const { email } = this._participants[participantId] || {};
|
||||
|
||||
return email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the formatted display name of a participant.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user