teams-for-linux icon indicating copy to clipboard operation
teams-for-linux copied to clipboard

Feature Request - Persistent Notification

Open benyaminl opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. Sometimes I think it's better to have persistent notification like other messaging works, or like in windows. So I think, and hope, if it's possible, please make notification can be persistent on Teams for Linux.

I do know there is number of notiification on teams icon on task bar, just... we need to history of chat notification on gdbus or such... it will be very very useful... :')

Describe the solution you'd like An option that can enable persistent notification, or at least longer dismisable notification

Describe alternatives you've considered I tried using MS teams on way droid, and using GSConnect/KDEConnect, and having persistent notification, but it's a hazzle, as I now have 2 application running at same time

Additional context

  • Related configuration https://stackoverflow.com/a/36868084, and related project https://github.com/nativefier/nativefier

I haven't tried to override the notification yet using user script on Browser, but I think I will try that....

benyaminl avatar Aug 27 '23 10:08 benyaminl

this seems duplicated with https://github.com/IsmaelMartinez/teams-for-linux/issues/725

Can you add this info in that issue and when/if we get a group of people willing to develop a v2 version, we can improve those notifications. Thanks!

IsmaelMartinez avatar Sep 01 '23 10:09 IsmaelMartinez

@IsmaelMartinez It's quire different. I only know that the notification on Web directly removed and not showing in gnome notification list, but this userscript works

function setNotificationCallback() {

    const OldNotify = window.Notification;
    const newNotify = class Notification {
        constructor(title, opt){
            console.log(title); console.log(opt);
            opt.requireInteraction = false;
	    opt.silent = false;
	    opt.badge = "";
	    opt.data = null
	    opt.dir = "auto";
	    opt.scenario = "default";
	    opt.tag = Math.floor(Math.random()*100000);
	    opt.renotify = false;
	    setTimeout(() => {
	    	new OldNotify(title, opt);
	    },2000);           
            return new OldNotify(title, opt);
        }
    };
    newNotify.requestPermission = OldNotify.requestPermission.bind(OldNotify);
    Object.defineProperty(newNotify, 'permission', {
        get: () => {
            return OldNotify.permission;
        }
    });

    window.Notification = newNotify;
}
setNotificationCallback();

benyaminl avatar Sep 02 '23 04:09 benyaminl

If you can put this in a config option, we can release it and see if people start using it. Thanks for your contribution!

IsmaelMartinez avatar Sep 02 '23 06:09 IsmaelMartinez

Notification behaviour varies from DE to DE, one that works on GNOME might not or cause unexpected outcomes. window.Notification is already overridden. You can search in the code. I'm not at the desk so can't share the link.

jijojosephk avatar Sep 02 '23 08:09 jijojosephk