Philipp Hörist pushed to branch mute-chat-notifications at gajim / gajim
Commits:
c4ee41b5 by Philipp Hörist at 2023-04-02T15:35:11+02:00
cq: Apply isort
- - - - -
3cffc7b8 by Philipp Hörist at 2023-04-02T17:35:15+02:00
new: Reset mute setting
- - - - -
2 changed files:
- gajim/common/modules/contacts.py
- gajim/gtk/builder.pyi
Changes:
=====================================
gajim/common/modules/contacts.py
=====================================
@@ -24,6 +24,7 @@
from datetime import timezone
import cairo
+from gi.repository import GLib
from nbxmpp.const import Affiliation
from nbxmpp.const import Chatstate
from nbxmpp.const import Role
@@ -342,7 +343,11 @@ def is_muted(self) -> bool:
return False
until = datetime.fromisoformat(mute_until)
- return until > datetime.now(timezone.utc)
+ is_muted = until > datetime.now(timezone.utc)
+ if not is_muted:
+ # Reset the setting to default
+ GLib.idle_add(self.settings.set, 'mute_until', None)
+ return is_muted
def __repr__(self) -> str:
return f'{self.jid} ({self._account})'
=====================================
gajim/gtk/builder.pyi
=====================================
@@ -6,7 +6,6 @@ from gi.repository import Atk
from gi.repository import Gtk
from gi.repository import GtkSource
-
class Builder(Gtk.Builder):
...
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/46d2d222e39a22934708962a125f0db…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/46d2d222e39a22934708962a125f0db…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch mute-chat-notifications at gajim / gajim
Commits:
e27b71b7 by Philipp Hörist at 2023-04-02T11:43:46+02:00
imprv: Simplify return condition
- - - - -
1 changed file:
- gajim/common/modules/contacts.py
Changes:
=====================================
gajim/common/modules/contacts.py
=====================================
@@ -342,9 +342,7 @@ def is_muted(self) -> bool:
return False
until = datetime.fromisoformat(mute_until)
- if until > datetime.now(timezone.utc):
- return True
- return False
+ return until > datetime.now(timezone.utc)
def __repr__(self) -> str:
return f'{self.jid} ({self._account})'
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/e27b71b7011da63f16244f4f9a07c99a…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/e27b71b7011da63f16244f4f9a07c99a…
You're receiving this email because of your account on dev.gajim.org.