Giter Site home page Giter Site logo

Comments (19)

otheus avatar otheus commented on August 9, 2024 6

Just to be clear, the preferred way on MacOS is to use the notifications API, so that do-not-disturb mode and other OS behavior is consistent.

from element-desktop.

pepyakin avatar pepyakin commented on August 9, 2024 3

Op here. FWIW, for me this was solved by migrating to the web version, to PWA app within Chrome to be exact.

from element-desktop.

JMoVS avatar JMoVS commented on August 9, 2024 3

Hi @HarHarLinks , the mentioned specs are unrelated to this bug. They are a great feature, but the bug here is about being a good platform citizen as a desktop app.

from element-desktop.

Conan-Kudo avatar Conan-Kudo commented on August 9, 2024 3

I would really like this feature to be implemented. Element is the only application I run on my desktop (Fedora Linux 38 with KDE Plasma Desktop) that does not respect the system-wide do-not-disturb setting. Even Slack (also an Electron app) respects the setting properly.

from element-desktop.

otheus avatar otheus commented on August 9, 2024 2

@tawfiek In general, I think this is a good idea. It always seems suspect to me to rely on 3rd party libraries whose code has not been audited and which cannot be absolutely authenticated. AFter all, this is communication software for private data...

from element-desktop.

Half-Shot avatar Half-Shot commented on August 9, 2024 1

The Do Not Disturb mode on gnome is the dconf setting /org/gnome/desktop/notifications/show-banners. Element notifs should already be blocked by the setting, but sounds won't be. We will need to find a library that allows us to listen on dbus for when this value is updated.

from element-desktop.

pszypowicz avatar pszypowicz commented on August 9, 2024 1

There seem to be a user space lib to detect dnd mode on mac: https://github.com/felixrieseberg/macos-notification-state

My workaround is to close element app when I'm expecting to focus on work. Not ideal one may say /sarcasm

from element-desktop.

aaronraimist avatar aaronraimist commented on August 9, 2024

:/ I don't think Electron has a built in way to tell if DND is enabled. Looks like Electron recommends using this library https://github.com/felixrieseberg/electron-notification-state which only has one commit... maybe it's just really stable and good at it's current state?

from element-desktop.

lampholder avatar lampholder commented on August 9, 2024

That felixrieseberg library just wraps two other libraries for fetching mac/windows notification states (also written by felixrieseberg, and with 7 and 9 commits respectively). Scanning the code it does look feasible that it might just work?

from element-desktop.

yajo avatar yajo commented on August 9, 2024

As explained in element-hq/element-web#13941, the same happens in linux.

from element-desktop.

Half-Shot avatar Half-Shot commented on August 9, 2024

#133 should hopefully address folks on GNOME

from element-desktop.

t3chguy avatar t3chguy commented on August 9, 2024

Electron does not support accessing that API seemingly, but closest we can get is to try and read the DND state using https://www.electronjs.org/docs/tutorial/notifications#do-not-disturb--session-state

from element-desktop.

tawfiek avatar tawfiek commented on August 9, 2024

Electron does not support accessing that API seemingly, but closest we can get is to try and read the DND state using https://www.electronjs.org/docs/tutorial/notifications#do-not-disturb--session-state

Electron refers to the same package of felixrieseberg in there official docs, but in the package's GitHub repo I found more than one issue complaint that this package is deprecated for the newer versions of node, I think it's a bad Idea to rely on it in element.
maybe we can fork it update it's dependencies and republish it, then use it into our codebase or ...
"it" refers to the packages that this lib wrap, since it just a warper for : macos-notification-state and windows-notification-state written with the same guy as @lampholder said

from element-desktop.

germain-gg avatar germain-gg commented on August 9, 2024

We have a do not disturb mode in user settings now. We could hook the OS level setting to honour that user preference.

From what I understand we will only be able to do that on the Electron side as the media queries are not exposing any of that

from element-desktop.

HarHarLinks avatar HarHarLinks commented on August 9, 2024

We have a do not disturb mode in user settings now.

This was removed from labs in matrix-org/matrix-react-sdk@4d7b7c4 and I miss it dearly.

from element-desktop.

JMoVS avatar JMoVS commented on August 9, 2024

surely there is a way 4 years later to use the native notification system and get do not disturb following for free, right? Is this not annoying others?

from element-desktop.

HarHarLinks avatar HarHarLinks commented on August 9, 2024

There is some related spec work (currently not progressing):

matrix-org/matrix-spec-proposals#3026
matrix-org/matrix-spec-proposals#3767

from element-desktop.

uzantome avatar uzantome commented on August 9, 2024

Here's a PR from Mattermost, another electron-based messenger, implementing this:

mattermost/desktop#1629

from element-desktop.

t3chguy avatar t3chguy commented on August 9, 2024

@uzantome looks like it only supports Linux & Windows, and would create extra cost on the latter as it'd require signing extra binaries

from element-desktop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.