Skip to content

Commit

Permalink
Merge pull request #887 from jijojosephk/issue-871
Browse files Browse the repository at this point in the history
  • Loading branch information
jijojosephk authored Jul 9, 2023
2 parents 9483bce + d6d52d7 commit c681a52
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Here is the list of available arguments and its usage:
| customBGServiceConfigFetchInterval | A numeric value in seconds as poll interval to download custom background service configuration. If 0, it will be downloaded only at application start | 0 |
| menubar | A value controls the menu bar behaviour (auto/visible/hidden) | auto |
| disableAutogain | A flag indicates whether to disable mic auto gain or not | false |
| defaultURLHandler | Default application to be used to open the HTTP URLs | |



Expand Down
5 changes: 5 additions & 0 deletions app/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ function argv(configPath) {
default: false,
describe: 'A flag indicates whether to disable mic auto gain or not',
type: 'boolean'
},
defaultURLHandler:{
default:'',
describe:'Default application to be used to open the HTTP URLs',
type:'string'
}
})
.parse(process.argv.slice(1));
Expand Down
21 changes: 18 additions & 3 deletions app/mainAppWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { StreamSelector } = require('../streamSelector');
const { LucidLog } = require('lucid-log');
const { SpellCheckProvider } = require('../spellCheckProvider');
const helpers = require('../helpers');
const exec = require('child_process').exec;

let blockerId = null;

Expand Down Expand Up @@ -43,9 +44,9 @@ exports.onAppReady = async function onAppReady(mainConfig) {
});

window = await createWindow();

new Menus(window, config, config.appIcon);

addEventHandlers();

const url = processArgs(process.argv);
Expand Down Expand Up @@ -313,7 +314,7 @@ function secureOpenLink(details) {
const action = getLinkAction();

if (action === 0) {
shell.openExternal(details.url);
openInBrowser(details);
}

/**
Expand All @@ -335,6 +336,20 @@ function secureOpenLink(details) {
return returnValue;
}

function openInBrowser(details) {
if (config.defaultURLHandler.trim() !== '') {
exec(`${config.defaultURLHandler.trim()} ${details.url}`, openInBrowserErrorHandler);
} else {
shell.openExternal(details.url);
}
}

function openInBrowserErrorHandler(error) {
if (error) {
logger.error(error.message);
}
}

function getLinkAction() {
const action = isControlPressed ? dialog.showMessageBoxSync(window, {
type: 'warning',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teams-for-linux",
"version": "1.2.2",
"version": "1.2.3",
"main": "app/index.js",
"description": "Unofficial client for Microsoft Teams for Linux",
"homepage": "https://github.com/IsmaelMartinez/teams-for-linux",
Expand Down

0 comments on commit c681a52

Please sign in to comment.