From 9671563189d45c26ce26b67ffb2dfd34b330198a Mon Sep 17 00:00:00 2001 From: Nathan Anderson Date: Thu, 25 Oct 2018 10:21:21 -0700 Subject: [PATCH 1/6] Reformatted notifications so messages are easier to read in GNOME notifications --- app/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/index.js b/app/lib/index.js index 1b4764dd..859b9278 100755 --- a/app/lib/index.js +++ b/app/lib/index.js @@ -64,7 +64,7 @@ app.on('ready', () => { ipcMain.on('notifications', async (e, msg) => { if (msg.count > 0) { - const body = "You got " + msg.count + " notification(s). " + ((msg.text) ? " " + msg.text + " " : ""); + const body = "(" + msg.count + "): " + ((msg.text) ? "" + msg.text : ""); const notification = new NativeNotification( "Microsoft Teams", { From a6082859ebe3c6b0126156515ad3f622f75a3585 Mon Sep 17 00:00:00 2001 From: IsmaelMartinez Date: Sun, 28 Oct 2018 19:47:17 +0000 Subject: [PATCH 2/6] Fixing #6. passing the partition as a parameter didn't work when passing it as a object, need to pass it as value. --- app/lib/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/lib/index.js b/app/lib/index.js index 1b4764dd..5a5ac3fc 100755 --- a/app/lib/index.js +++ b/app/lib/index.js @@ -7,7 +7,7 @@ const NativeNotification = require('electron-native-notification'); const Menus = require('./menus'); const configBuilder = require('./config'); -function createWindow(config, iconPath) { +function createWindow(part, iconPath) { // Load the previous state with fallback to defaults let windowState = windowStateKeeper({ defaultWidth: 0, @@ -28,7 +28,7 @@ function createWindow(config, iconPath) { icon: path.join(__dirname, 'assets', 'icons', 'icon-96x96.png'), webPreferences: { - partition: config.partition, + partition: part, preload: path.join(__dirname, 'browser', 'index.js'), nativeWindowOpen: true, plugins: true, @@ -54,7 +54,7 @@ app.on('ready', () => { ); let isFirstLoginTry = true; const config = configBuilder(app.getPath('userData')); - var window = createWindow(config, iconPath); + var window = createWindow(config.partition, iconPath); let menus = new Menus(config, iconPath); menus.register(window); From 873d69cc089a6e7d998db0cc45d603fb66762ed0 Mon Sep 17 00:00:00 2001 From: IsmaelMartinez Date: Sun, 28 Oct 2018 19:48:50 +0000 Subject: [PATCH 3/6] Increasing version to 0.1.7 in order to try to fix issue number #6 --- app/package.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/package.json b/app/package.json index a76e0e0e..c8e6792a 100755 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "teams-for-linux", - "version": "0.1.6", + "version": "0.1.7", "description": "Microsoft Teams for Linux", "main": "lib/index.js", "author": "Ivelin Velkov ", diff --git a/package.json b/package.json index 1f031e04..d71b8f6b 100755 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "teams-for-linux", - "version": "0.1.6", + "version": "0.1.7", "description": "Unofficial client for Microsoft Teams for Linux", - "homepage": "https://github.com/JamieMagee/teams-for-linux", + "homepage": "https://github.com/IsmaelMartinez/teams-for-linux", "keywords": [ "Teams", "Microsoft Teams" From 23837a05ace721aa5f418d0ab47e03414b87caa9 Mon Sep 17 00:00:00 2001 From: IsmaelMartinez Date: Sun, 28 Oct 2018 19:56:45 +0000 Subject: [PATCH 4/6] Changing a bit the pull request #5 to only show the ': ' if there is a message and not in all the cases --- app/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/index.js b/app/lib/index.js index a5f09464..9e8cbe2d 100755 --- a/app/lib/index.js +++ b/app/lib/index.js @@ -64,7 +64,7 @@ app.on('ready', () => { ipcMain.on('notifications', async (e, msg) => { if (msg.count > 0) { - const body = "(" + msg.count + "): " + ((msg.text) ? "" + msg.text : ""); + const body = "(" + msg.count + ")" + ((msg.text) ? ": " + msg.text : ""); const notification = new NativeNotification( "Microsoft Teams", { From 5c34e23b0fffbcf1b59b1af9f6c63ec8d28186dc Mon Sep 17 00:00:00 2001 From: IsmaelMartinez Date: Sun, 28 Oct 2018 21:36:11 +0000 Subject: [PATCH 5/6] Adding a possible fix to @mentions not working when edge user agent selected. Need to test it tomorrow at work before releasing --- app/lib/browser/index.js | 12 +++++------- app/lib/config/index.js | 4 ++-- app/lib/index.js | 8 ++++---- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/app/lib/browser/index.js b/app/lib/browser/index.js index 8f1171f7..a010b518 100644 --- a/app/lib/browser/index.js +++ b/app/lib/browser/index.js @@ -4,7 +4,6 @@ const path = require('path'); const { ipcRenderer } = require('electron'); const trayNotifications = require('./tray-notifications'); - // const nativeNotifications = require('./native-notifications'); require('./zoom')(); const iconPath = path.join(__dirname, '../assets/icons/icon-96x96.png'); @@ -14,10 +13,9 @@ iconPath }); - // document.addEventListener( - // 'DOMContentLoaded', - // nativeNotifications({ - // ipc: ipcRenderer, - // iconPath - // })); + //change userAgent to chrome to fix the issue of notifications disapearing. + document.addEventListener( + 'DOMContentLoaded', + navigator.__defineGetter__('userAgent', () => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36') + ); })(); diff --git a/app/lib/config/index.js b/app/lib/config/index.js index 5669941d..5984dd9c 100644 --- a/app/lib/config/index.js +++ b/app/lib/config/index.js @@ -25,13 +25,13 @@ function argv(configPath) { userAgent: { describe: 'HTTP User Agent', type: 'string', - default: 'chrome' + default: 'edge' }, edgeUserAgent: { describe: 'Microsoft Edge User Agent', type: 'string', default: - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134' + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/12.246' }, chromeUserAgent: { describe: 'Google Chrome User Agent', diff --git a/app/lib/index.js b/app/lib/index.js index 9e8cbe2d..bd9ea736 100755 --- a/app/lib/index.js +++ b/app/lib/index.js @@ -64,7 +64,7 @@ app.on('ready', () => { ipcMain.on('notifications', async (e, msg) => { if (msg.count > 0) { - const body = "(" + msg.count + ")" + ((msg.text) ? ": " + msg.text : ""); + const body = ((msg.text) ? "(" + msg.count + "): " + msg.text : "You got " + msg.count + " notification(s)"); const notification = new NativeNotification( "Microsoft Teams", { @@ -93,13 +93,13 @@ app.on('ready', () => { app.exit(0); } }); - + if (config.userAgent === 'edge') { window.webContents.setUserAgent(config.edgeUserAgent); } else { window.webContents.setUserAgent(config.chromeUserAgent); - } - + } + window.once('ready-to-show', () => window.show()); window.webContents.on('did-finish-load', function () { From 3367c2896e7364da3ce479a2c912b0b78f2cee28 Mon Sep 17 00:00:00 2001 From: Ismael Date: Mon, 29 Oct 2018 10:52:20 +0000 Subject: [PATCH 6/6] Trying a fix for mentions with edge user agent so we can have video and mentions --- app/lib/browser/index.js | 2 +- app/lib/config/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/browser/index.js b/app/lib/browser/index.js index a010b518..df7c7e2a 100644 --- a/app/lib/browser/index.js +++ b/app/lib/browser/index.js @@ -16,6 +16,6 @@ //change userAgent to chrome to fix the issue of notifications disapearing. document.addEventListener( 'DOMContentLoaded', - navigator.__defineGetter__('userAgent', () => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36') + navigator.__defineGetter__('userAgent', () => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/12.246') ); })(); diff --git a/app/lib/config/index.js b/app/lib/config/index.js index 5984dd9c..bf7a9bf6 100644 --- a/app/lib/config/index.js +++ b/app/lib/config/index.js @@ -25,7 +25,7 @@ function argv(configPath) { userAgent: { describe: 'HTTP User Agent', type: 'string', - default: 'edge' + default: 'chrome' }, edgeUserAgent: { describe: 'Microsoft Edge User Agent',