Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanfbrito committed Oct 20, 2023
2 parents 8df472e + 0e71f31 commit 645a5c0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"zip"
],
"icon": "build/icon.icns",
"bundleVersion": "118",
"bundleVersion": "119",
"helperBundleId": "chat.rocket.electron.helper",
"type": "distribution",
"artifactName": "rocketchat-${version}-${os}.${ext}",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"productName": "Rocket.Chat",
"name": "rocketchat",
"description": "Official OSX, Windows, and Linux Desktop Clients for Rocket.Chat",
"version": "3.9.8",
"version": "3.9.9",
"author": "Rocket.Chat Support <[email protected]>",
"copyright": "© 2016-2023, Rocket.Chat",
"homepage": "https://rocket.chat",
Expand Down Expand Up @@ -116,7 +116,7 @@
"chokidar": "^3.5.3",
"conventional-changelog-cli": "^2.2.2",
"convert-svg-to-png": "^0.5.0",
"electron": "24.8.3",
"electron": "24.8.5",
"electron-builder": "^23.6.0",
"electron-devtools-installer": "^3.2.0",
"electron-notarize": "^1.2.2",
Expand Down
21 changes: 18 additions & 3 deletions src/deepLinks/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ type AuthenticationParams = {
type OpenRoomParams = {
host: string;
path?: string;
token?: string;
userId?: string;
};

type InviteParams = {
Expand Down Expand Up @@ -138,16 +140,27 @@ const performAuthentication = async ({
});

// https://developer.rocket.chat/rocket.chat/deeplink#channel-group-dm
const performOpenRoom = async ({ host, path }: OpenRoomParams): Promise<void> =>
const performOpenRoom = async ({
host,
path,
token,
userId,
}: OpenRoomParams): Promise<void> =>
performOnServer(host, async (serverUrl) => {
if (!path) {
return;
}
if (!/^\/?(direct|group|channel|livechat)\/[0-9a-zA-Z-_.]+/.test(path)) {
return;
}
const url = new URL(path, serverUrl);
if (token && userId) {
url.searchParams.append('resumeToken', token);
url.searchParams.append('userId', userId);
}

const webContents = await getWebContents(serverUrl);
webContents.loadURL(new URL(path, serverUrl).href);
webContents.loadURL(url.href);
});

const performInvite = async ({ host, path }: InviteParams): Promise<void> =>
Expand Down Expand Up @@ -191,8 +204,10 @@ const processDeepLink = async (deepLink: string): Promise<void> => {
case 'room': {
const host = args.get('host') ?? undefined;
const path = args.get('path') ?? undefined;
const token = args.get('token') ?? undefined;
const userId = args.get('userId') ?? undefined;
if (host && path) {
await performOpenRoom({ host, path });
await performOpenRoom({ host, path, token, userId });
}
break;
}
Expand Down
11 changes: 5 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9999,16 +9999,16 @@ __metadata:
languageName: node
linkType: hard

"electron@npm:24.8.3":
version: 24.8.3
resolution: "electron@npm:24.8.3"
"electron@npm:24.8.5":
version: 24.8.5
resolution: "electron@npm:24.8.5"
dependencies:
"@electron/get": ^2.0.0
"@types/node": ^18.11.18
extract-zip: ^2.0.1
bin:
electron: cli.js
checksum: bbc2e281461cae811537962e4ee6beabd7f9111f3cfdad02cc22081830533161277af1329c04cf917d85f3c69879a04fa3bec5f9db68f137192fbba7157566ec
checksum: f4be9639c3eb681f987f3d13bbfce72f81f2f1e1ad0c1fee860053ba80659c861f980bec6a14c049915729c2d5dd111281897ee82a7334dc5745ced697ed2d1c
languageName: node
linkType: hard

Expand Down Expand Up @@ -17030,8 +17030,7 @@ __metadata:
chokidar: ^3.5.3
conventional-changelog-cli: ^2.2.2
convert-svg-to-png: ^0.5.0
dotenv: ~16.3.1
electron: 24.8.3
electron: 24.8.5
electron-builder: ^23.6.0
electron-devtools-installer: ^3.2.0
electron-dl: ^3.5.0
Expand Down

0 comments on commit 645a5c0

Please sign in to comment.