Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-51514] Allow Calls widget to open user settings #3109

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export type DesktopAPI = {
openStopRecordingModal: (channelID: string) => void;
onOpenStopRecordingModal: (listener: (channelID: string) => void) => () => void;

openCallsUserSettings: () => void;
onOpenCallsUserSettings: (listener: () => void) => () => void;

// Utility
unregister: (channel: string) => void;
}
2 changes: 2 additions & 0 deletions api-types/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,7 @@ export type DesktopAPI = {
onOpenThreadForCalls: (listener: (threadID: string) => void) => () => void;
openStopRecordingModal: (channelID: string) => void;
onOpenStopRecordingModal: (listener: (channelID: string) => void) => () => void;
openCallsUserSettings: () => void;
onOpenCallsUserSettings: (listener: () => void) => () => void;
streamer45 marked this conversation as resolved.
Show resolved Hide resolved
unregister: (channel: string) => void;
};
4 changes: 2 additions & 2 deletions api-types/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mattermost/desktop-api",
"version": "5.9.0-1",
"version": "5.10.0-1",
"description": "Shared types for the Desktop App API provided to the Web App",
"keywords": [
"mattermost"
Expand Down
1 change: 1 addition & 0 deletions src/common/communication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export const CALLS_ERROR = 'calls-error';
export const CALLS_JOIN_REQUEST = 'calls-join-request';
export const CALLS_WIDGET_OPEN_THREAD = 'calls-widget-open-thread';
export const CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL = 'calls-widget-open-stop-recording-modal';
export const CALLS_WIDGET_OPEN_USER_SETTINGS = 'calls-widget-open-user-settings';

export const REQUEST_CLEAR_DOWNLOADS_DROPDOWN = 'request-clear-downloads-dropdown';
export const CLOSE_DOWNLOADS_DROPDOWN = 'close-downloads-dropdown';
Expand Down
4 changes: 4 additions & 0 deletions src/main/preload/externalAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
CALLS_POPOUT_FOCUS,
CALLS_WIDGET_OPEN_THREAD,
CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL,
CALLS_WIDGET_OPEN_USER_SETTINGS,
GET_DESKTOP_SOURCES,
UNREADS_AND_MENTIONS,
LEGACY_OFF,
Expand Down Expand Up @@ -117,6 +118,9 @@ const desktopAPI: DesktopAPI = {
openStopRecordingModal: (channelID) => ipcRenderer.send(CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL, channelID),
onOpenStopRecordingModal: (listener) => createListener(CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL, listener),

openCallsUserSettings: () => ipcRenderer.send(CALLS_WIDGET_OPEN_USER_SETTINGS),
onOpenCallsUserSettings: (listener) => createListener(CALLS_WIDGET_OPEN_USER_SETTINGS, listener),

// Utility
unregister: (channel) => ipcRenderer.removeAllListeners(channel),
};
Expand Down
2 changes: 2 additions & 0 deletions src/main/windows/callsWidgetWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
CALLS_WIDGET_SHARE_SCREEN,
CALLS_WIDGET_OPEN_THREAD,
CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL,
CALLS_WIDGET_OPEN_USER_SETTINGS,
DESKTOP_SOURCES_MODAL_REQUEST,
GET_DESKTOP_SOURCES,
UPDATE_SHORTCUT_MENU,
Expand Down Expand Up @@ -77,6 +78,7 @@ export class CallsWidgetWindow {
ipcMain.on(CALLS_JOIN_REQUEST, this.forwardToMainApp(CALLS_JOIN_REQUEST));
ipcMain.on(CALLS_WIDGET_OPEN_THREAD, this.handleCallsOpenThread);
ipcMain.on(CALLS_WIDGET_OPEN_STOP_RECORDING_MODAL, this.handleCallsOpenStopRecordingModal);
ipcMain.on(CALLS_WIDGET_OPEN_USER_SETTINGS, this.forwardToMainApp(CALLS_WIDGET_OPEN_USER_SETTINGS));

// deprecated in favour of CALLS_LINK_CLICK
ipcMain.on(CALLS_WIDGET_CHANNEL_LINK_CLICK, this.handleCallsWidgetChannelLinkClick);
Expand Down
1 change: 1 addition & 0 deletions src/types/externalAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export interface ExternalAPI {
createListener(event: 'desktop-sources-modal-request', listener: () => void): () => void;
createListener(event: 'calls-widget-open-thread', listener: (threadID: string) => void): () => void;
createListener(event: 'calls-widget-open-stop-recording-modal', listener: (channelID: string) => void): () => void;
createListener(event: 'calls-widget-open-user-settings', listener: () => void): () => void;
enzowritescode marked this conversation as resolved.
Show resolved Hide resolved
}
Loading