ulyssa / iamb

A Matrix client for Vim addicts
https://iamb.chat
Apache License 2.0
608 stars 45 forks source link

Allow notifications on open room if terminal not focused #281

Closed Andrew-Collins closed 2 months ago

Andrew-Collins commented 5 months ago

Hi,

This PR is to implement #276.

It does this by putting the focused state of the application into the store and then checks it in the notifications handler.

This results in notifications being muted only if the room is currently displayed and the terminal is in focus.

If you would like a config entry to control this just let me know. :)

benjajaja commented 4 months ago

Looks great, thank you!

ulyssa commented 2 months ago

@Andrew-Collins This is a great addition, thank you! :pray:

And I believe that @benjajaja is correct that we don't get the focused state on startup, but only whenever the window changes. (And that doesn't always happen with every terminal either). Defaulting focused to true is the right move. :+1: