feat(base/config): notify user on conference destruction option (#15697)

Notify user about conference destruction using a new config option.
This commit is contained in:
Calinteodor
2025-03-05 09:52:22 +02:00
committed by GitHub
parent f83ad5af27
commit cfbdbd4783
9 changed files with 30 additions and 8 deletions

View File

@@ -2278,8 +2278,10 @@ export default {
* @param {boolean} [requestFeedback=false] if user feedback should be
* @param {string} [hangupReason] the reason for leaving the meeting
* requested
* @param {boolean} [notifyOnConferenceTermination] whether to notify
* the user on conference termination
*/
hangup(requestFeedback = false, hangupReason) {
hangup(requestFeedback = false, hangupReason, notifyOnConferenceTermination) {
APP.store.dispatch(disableReceiver());
this._stopProxyConnection();
@@ -2298,7 +2300,7 @@ export default {
if (requestFeedback) {
const feedbackDialogClosed = (feedbackResult = {}) => {
if (!feedbackResult.wasDialogShown && hangupReason) {
if (!feedbackResult.wasDialogShown && hangupReason && notifyOnConferenceTermination) {
return APP.store.dispatch(
openLeaveReasonDialog(hangupReason)).then(() => feedbackResult);
}

View File

@@ -755,6 +755,9 @@ var config = {
// and microsoftApiApplicationClientID
// enableCalendarIntegration: false,
// Whether to notify when the conference is terminated because it was destroyed.
// notifyOnConferenceDestruction: true,
// The client id for the google APIs used for the calendar integration, youtube livestreaming, etc.
// googleApiApplicationClientID: '<client_id>',

View File

@@ -4,7 +4,7 @@ import { JitsiConferenceErrors } from '../lib-jitsi-meet';
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
import { CONFERENCE_FAILED } from './actionTypes';
import { conferenceLeft } from './actions';
import { conferenceLeft } from './actions.native';
import { TRIGGER_READY_TO_CLOSE_REASONS } from './constants';
import './middleware.any';
@@ -15,10 +15,20 @@ MiddlewareRegistry.register(store => next => action => {
switch (action.type) {
case CONFERENCE_FAILED: {
const { getState } = store;
const state = getState();
const { notifyOnConferenceDestruction = true } = state['features/base/config'];
if (error?.name !== JitsiConferenceErrors.CONFERENCE_DESTROYED) {
break;
}
if (!notifyOnConferenceDestruction) {
dispatch(conferenceLeft(action.conference));
dispatch(appNavigate(undefined));
break;
}
const [ reason ] = error.params;
const reasonKey = Object.keys(TRIGGER_READY_TO_CLOSE_REASONS)[

View File

@@ -122,12 +122,14 @@ MiddlewareRegistry.register(store => next => action => {
}
if (errorName === JitsiConferenceErrors.CONFERENCE_DESTROYED) {
const state = getState();
const { notifyOnConferenceDestruction = true } = state['features/base/config'];
const [ reason ] = action.error.params;
const titlekey = Object.keys(TRIGGER_READY_TO_CLOSE_REASONS)[
Object.values(TRIGGER_READY_TO_CLOSE_REASONS).indexOf(reason)
];
dispatch(hangup(true, i18next.t(titlekey) || reason));
dispatch(hangup(true, i18next.t(titlekey) || reason, notifyOnConferenceDestruction));
}
releaseScreenLock();

View File

@@ -486,6 +486,7 @@ export interface IConfig {
short?: number;
};
notifications?: Array<string>;
notifyOnConferenceDestruction?: boolean;
openSharedDocumentOnJoin?: boolean;
opusMaxAverageBitrate?: number;
p2p?: {

View File

@@ -182,6 +182,7 @@ export default [
'mouseMoveCallbackInterval',
'notifications',
'notificationTimeouts',
'notifyOnConferenceDestruction',
'openSharedDocumentOnJoin',
'opusMaxAverageBitrate',
'p2p.backToP2PDelay',

View File

@@ -62,9 +62,11 @@ export function connect(id?: string, password?: string) {
* @param {boolean} [requestFeedback] - Whether to attempt showing a
* request for call feedback.
* @param {string} [feedbackTitle] - The feedback title.
* @param {boolean} [notifyOnConferenceTermination] - Whether to notify
* the user on conference termination.
* @returns {Function}
*/
export function hangup(requestFeedback = false, feedbackTitle?: string) {
export function hangup(requestFeedback = false, feedbackTitle?: string, notifyOnConferenceTermination?: boolean) {
// XXX For web based version we use conference hanging up logic from the old app.
return async (dispatch: IStore['dispatch']) => {
if (LocalRecordingManager.isRecordingLocally()) {
@@ -80,6 +82,6 @@ export function hangup(requestFeedback = false, feedbackTitle?: string) {
});
}
return APP.conference.hangup(requestFeedback, feedbackTitle);
return APP.conference.hangup(requestFeedback, feedbackTitle, notifyOnConferenceTermination);
};
}

View File

@@ -1,6 +1,6 @@
import { appNavigate } from '../app/actions.native';
import { KICKED_OUT } from '../base/conference/actionTypes';
import { conferenceLeft } from '../base/conference/actions';
import { conferenceLeft } from '../base/conference/actions.native';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import { notifyKickedOut } from './actions.native';

View File

@@ -35,7 +35,8 @@ MiddlewareRegistry.register(store => next => action => {
dispatch(hangup(true,
participantDisplayName ? i18next.t('dialog.kickTitle', { participantDisplayName })
: i18next.t('dialog.kickSystemTitle')));
: i18next.t('dialog.kickSystemTitle'),
true));
return result;
}