Skip to content

Commit 35c8bb0

Browse files
yash-rajpalpierre-lehnen-rc
authored andcommitted
chore!: Remove VoIP_TeamCollab_Enabled setting (#36941)
Co-authored-by: Pierre Lehnen <[email protected]>
1 parent fb0acf6 commit 35c8bb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+30
-91
lines changed

.changeset/cool-turtles-bathe.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@rocket.chat/meteor': major
3+
'@rocket.chat/media-calls': minor
4+
'@rocket.chat/i18n': minor
5+
---
6+
7+
Makes Voice Calls enabled by default when available

apps/meteor/app/lib/server/functions/saveUser/validateUserEditing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const isEditingUserRoles = (previousRoles: IUser['roles'], newRoles?: IUser['rol
1313
const isEditingField = (previousValue?: string, newValue?: string) => typeof newValue !== 'undefined' && newValue !== previousValue;
1414

1515
export const canEditExtension = async (newExtension?: string) => {
16-
if (!settings.get('VoIP_TeamCollab_Enabled')) {
16+
if (!settings.get('VoIP_TeamCollab_SIP_Integration_Enabled')) {
1717
return false;
1818
}
1919

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useSetting } from '@rocket.chat/ui-contexts';
22

33
export const useShowVoipExtension = () => {
4-
const isVoipSettingEnabled = useSetting('VoIP_TeamCollab_Enabled', false);
4+
const isVoipSettingEnabled = useSetting('VoIP_TeamCollab_SIP_Integration_Enabled', false);
55

66
return isVoipSettingEnabled;
77
};

apps/meteor/ee/server/settings/voip.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,20 @@ export function addSettings(): Promise<void> {
66
{
77
enterprise: true,
88
modules: ['teams-voip'],
9+
alert: 'VoIP_TeamCollab_Beta_Alert',
910
},
1011
async function () {
11-
const enableQuery = { _id: 'VoIP_TeamCollab_Enabled', value: true };
12-
13-
await this.add('VoIP_TeamCollab_Enabled', false, {
14-
type: 'boolean',
15-
public: true,
16-
invalidValue: false,
17-
alert: 'VoIP_TeamCollab_Beta_Alert',
18-
});
19-
2012
await this.section('VoIP_TeamCollab_WebRTC', async function () {
2113
await this.add('VoIP_TeamCollab_Ice_Servers', 'stun:stun.l.google.com:19302', {
2214
type: 'string',
2315
public: true,
2416
invalidValue: '',
25-
enableQuery,
2617
});
2718

2819
await this.add('VoIP_TeamCollab_Ice_Gathering_Timeout', 5000, {
2920
type: 'int',
3021
public: true,
3122
invalidValue: 5000,
32-
enableQuery,
3323
});
3424
});
3525

@@ -50,35 +40,30 @@ export function addSettings(): Promise<void> {
5040
type: 'string',
5141
public: false,
5242
invalidValue: '',
53-
enableQuery,
5443
});
5544

5645
await this.add('VoIP_TeamCollab_Drachtio_Port', 9022, {
5746
type: 'int',
5847
public: false,
5948
invalidValue: 9022,
60-
enableQuery,
6149
});
6250

6351
await this.add('VoIP_TeamCollab_Drachtio_Password', '', {
6452
type: 'password',
6553
secret: true,
6654
invalidValue: '',
67-
enableQuery,
6855
});
6956

7057
await this.add('VoIP_TeamCollab_SIP_Server_Host', '', {
7158
type: 'string',
7259
public: false,
7360
invalidValue: '',
74-
enableQuery,
7561
});
7662

7763
await this.add('VoIP_TeamCollab_SIP_Server_Port', 5060, {
7864
type: 'int',
7965
public: false,
8066
invalidValue: 5060,
81-
enableQuery,
8267
});
8368
});
8469
},

apps/meteor/server/services/media-call/service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,10 @@ export class MediaCallService extends ServiceClassInternal implements IMediaCall
282282
}
283283

284284
private getMediaServerSettings(): IMediaCallServerSettings {
285-
const enabled = settings.get<boolean>('VoIP_TeamCollab_Enabled') ?? false;
286-
const sipEnabled = enabled && (settings.get<boolean>('VoIP_TeamCollab_SIP_Integration_Enabled') ?? false);
285+
const sipEnabled = settings.get<boolean>('VoIP_TeamCollab_SIP_Integration_Enabled') ?? false;
287286
const forceSip = sipEnabled && (settings.get<boolean>('VoIP_TeamCollab_SIP_Integration_For_Internal_Calls') ?? false);
288287

289288
return {
290-
enabled,
291289
internalCalls: {
292290
requireExtensions: forceSip,
293291
routeExternally: forceSip ? 'always' : 'never',

apps/meteor/server/startup/migrations/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ import './v325';
3434
import './v326';
3535
import './v327';
3636
import './v328';
37+
import './v329';
3738

3839
export * from './xrun';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Settings } from '@rocket.chat/models';
2+
3+
import { addMigration } from '../../lib/migrations';
4+
5+
addMigration({
6+
version: 329,
7+
name: 'Remove VoIP Toggle Setting',
8+
async up() {
9+
await Settings.deleteOne({ _id: 'VoIP_TeamCollab_Enabled' });
10+
},
11+
});

apps/meteor/tests/end-to-end/api/users.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,11 @@ describe('[Users]', () => {
579579

580580
(IS_EE ? describe : describe.skip)('Voice call extension', () => {
581581
beforeEach(async () => {
582-
await updateSetting('VoIP_TeamCollab_Enabled', true);
582+
await updateSetting('VoIP_TeamCollab_SIP_Integration_Enabled', true);
583583
});
584584

585585
after(async () => {
586-
await updateSetting('VoIP_TeamCollab_Enabled', true);
586+
await updateSetting('VoIP_TeamCollab_SIP_Integration_Enabled', true);
587587
});
588588

589589
it('should create a user with a voice call extension', async () => {
@@ -644,7 +644,7 @@ describe('[Users]', () => {
644644
});
645645

646646
it('should not create a user if voip is disabled', async () => {
647-
await updateSetting('VoIP_TeamCollab_Enabled', false);
647+
await updateSetting('VoIP_TeamCollab_SIP_Integration_Enabled', false);
648648
await request
649649
.post(api('users.create'))
650650
.set(credentials)
@@ -2530,11 +2530,11 @@ describe('[Users]', () => {
25302530
});
25312531

25322532
after(async () => {
2533-
await Promise.all([deleteUser(user), updateSetting('VoIP_TeamCollab_Enabled', true)]);
2533+
await Promise.all([deleteUser(user), updateSetting('VoIP_TeamCollab_SIP_Integration_Enabled', true)]);
25342534
});
25352535

25362536
beforeEach(async () => {
2537-
await Promise.all([updateSetting('VoIP_TeamCollab_Enabled', true)]);
2537+
await Promise.all([updateSetting('VoIP_TeamCollab_SIP_Integration_Enabled', true)]);
25382538
});
25392539

25402540
it("should update the user's voice call extension", async () => {
@@ -2572,7 +2572,7 @@ describe('[Users]', () => {
25722572
});
25732573

25742574
it("should not update the user's voice call extension if voip setting is disabled", async () => {
2575-
await updateSetting('VoIP_TeamCollab_Enabled', false);
2575+
await updateSetting('VoIP_TeamCollab_SIP_Integration_Enabled', false);
25762576
await request
25772577
.post(api('users.update'))
25782578
.set(credentials)

ee/packages/media-calls/src/definition/IMediaCallServer.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export type MediaCallServerEvents = {
1111
};
1212

1313
export interface IMediaCallServerSettings {
14-
enabled: boolean;
15-
1614
internalCalls: {
1715
requireExtensions: boolean;
1816
routeExternally: 'never' | 'preferably' | 'always';

ee/packages/media-calls/src/server/getDefaultSettings.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { IMediaCallServerSettings } from '../definition/IMediaCallServer';
22

33
export function getDefaultSettings(): IMediaCallServerSettings {
44
return {
5-
enabled: false,
65
internalCalls: {
76
requireExtensions: false,
87
routeExternally: 'never',

0 commit comments

Comments
 (0)