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/46d2d222e39a22934708962a125f0dbd...