Skip to content

Commit

Permalink
handle teams v2 meeting invites differently than v1 invites. making t…
Browse files Browse the repository at this point in the history
…he default logger electron-log, as the config options seeem to be broken (#1378)
  • Loading branch information
IsmaelMartinez authored Aug 23, 2024
1 parent b960d94 commit 53971e3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Here is the list of available arguments and its usage:
| incomingCallCommand | Command to execute on an incoming call. (string) | |
| incomingCallCommandArgs | Arguments for the incomming call command. | [] |
| isCustomBackgroundEnabled | A boolean flag to enable/disable custom background images | false |
| logConfig | A string value to set the log manager to use (`Falsy`, `console`, or a valid electron-log configuration) | *console* |
| logConfig | A string value to set the log manager to use (`Falsy`, `console`, or a valid electron-log configuration) | *{}* (electron-log) |
| meetupJoinRegEx | Meetup-join and channel regular expession | /^https:\/\/teams\.(microsoft|live)\.com\/.*(?:meetup-join|channel)/g |
| menubar | A value controls the menu bar behaviour | *auto*, visible, hidden |
| minimized | Boolean to start the application minimized | false |
Expand Down
2 changes: 1 addition & 1 deletion app/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ function extractYargConfig(configObject, appVersion) {
type: 'boolean'
},
logConfig: {
default: 'console',
default: '{}',
describe: 'Electron-log configuration. See logger.js for configurable values. To disable it provide a Falsy value.',
type: 'object'
},
Expand Down
14 changes: 10 additions & 4 deletions app/mainAppWindow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,25 @@ function restoreWindow() {
}

function processArgs(args) {
const regMS = /^msteams:\/.*(?:meetup-join|channel)/g;
const v1msTeams = /^msteams:\/l\/(?:meetup-join|channel)/g;
const v2msTeams = /^msteams:\/\/teams.microsoft.com\/l\/(?:meetup-join|channel)/g;
console.debug('processArgs:', args);
for (const arg of args) {
console.debug(`testing RegExp processArgs ${new RegExp(config.meetupJoinRegEx).test(arg)}`);
if (new RegExp(config.meetupJoinRegEx).test(arg)) {
console.debug('A url argument received with https protocol');
window.show();
return arg;
}
if (regMS.test(arg)) {
console.debug('A url argument received with msteams protocol');
}
if (v1msTeams.test(arg)) {
console.debug('A url argument received with msteams v1 protocol');
window.show();
return config.url + arg.substring(8, arg.length);
}
if (v2msTeams.test(arg)) {
console.debug('A url argument received with msteams v2 protocol');
window.show();
return arg.replace('msteams', 'https');
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions com.github.IsmaelMartinez.teams_for_linux.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
<url type="bugtracker">https://github.com/IsmaelMartinez/teams-for-linux/issues</url>
<launchable type="desktop-id">com.github.IsmaelMartinez.teams_for_linux.desktop</launchable>
<releases>
<release version="1.9.4" date="2024-08-23">
<description>
<ul>
<li>Update the logger to be `electron-log` by default, and update the documentation, as the config options don't seem to overwrite the logger</li>
<li>Adding a new conditional for msteams meeting invites to handle the differences between v1 and v2</li>
</ul>
</description>
</release>
<release version="1.9.3" date="2024-08-23">
<description>
<ul>
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.9.3",
"version": "1.9.4",
"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 53971e3

Please sign in to comment.