Philipp Hörist pushed to branch master at gajim / gajim


Commits:
ec2d324a by Philipp Hörist at 2025-08-31T00:20:43+02:00
change: Remove support for answering entity time queries

Users can set the timezone in their profile via VCard.

- - - - -


3 changed files:

- gajim/common/client.py
- gajim/common/modules/entity_time.py
- gajim/gtk/preference/account.py


Changes:

=====================================
gajim/common/client.py
=====================================
@@ -479,7 +479,6 @@ def _finish_connect(self) -> None:
 
         self.get_module('Bookmarks').request_bookmarks()
         self.get_module('SoftwareVersion').set_enabled(True)
-        self.get_module('EntityTime').set_enabled(True)
         self.get_module('LastActivity').set_enabled(True)
         self.get_module('Annotations').request_annotations()
         self.get_module('Blocking').get_blocking_list()


=====================================
gajim/common/modules/entity_time.py
=====================================
@@ -6,14 +6,8 @@
 
 from __future__ import annotations
 
-from typing import cast
-
-from nbxmpp.protocol import JID
-
-from gajim.common import app
 from gajim.common import types
 from gajim.common.modules.base import BaseModule
-from gajim.common.modules.contacts import BareContact
 
 
 class EntityTime(BaseModule):
@@ -29,24 +23,3 @@ def __init__(self, con: types.Client) -> None:
         BaseModule.__init__(self, con)
 
         self.handlers = []
-
-    def set_enabled(self, enabled: bool) -> None:
-        if not enabled:
-            self._nbxmpp('EntityTime').disable()
-            return
-
-        if not app.settings.get_account_setting(self._account,
-                                                'send_time_info'):
-            return
-
-        self._nbxmpp('EntityTime').enable()
-        self._nbxmpp('EntityTime').set_allow_reply_func(self._allow_reply)
-
-    def _allow_reply(self, jid: JID) -> bool:
-        bare_jid = jid.new_as_bare()
-        item = self._con.get_module('Roster').get_item(bare_jid)
-        if item is None:
-            return False
-
-        contact = cast(BareContact, self._get_contact(bare_jid))
-        return contact.is_subscribed


=====================================
gajim/gtk/preference/account.py
=====================================
@@ -212,14 +212,6 @@ def __init__(self, account: str) -> None:
                 callback=self._send_idle_time,
                 desc=_("Disclose the time of your last activity"),
             ),
-            Setting(
-                SettingKind.SWITCH,
-                _("Local System Time"),
-                SettingType.ACCOUNT_CONFIG,
-                "send_time_info",
-                callback=self._send_time_info,
-                desc=_("Disclose the local system time of the device Gajim 
runs on"),
-            ),
             Setting(
                 SettingKind.SWITCH,
                 _("Operating System"),
@@ -344,10 +336,6 @@ def _send_idle_time(self, state: bool, _data: Any) -> None:
         if self._client is not None:
             self._client.get_module("LastActivity").set_enabled(state)
 
-    def _send_time_info(self, state: bool, _data: Any) -> None:
-        if self._client is not None:
-            self._client.get_module("EntityTime").set_enabled(state)
-
     def _send_os_info(self, state: bool, _data: Any) -> None:
         if self._client is not None:
             self._client.get_module("SoftwareVersion").set_enabled(state)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/ec2d324a2bb5b1ae954f374ba980a9cac7a979cf

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/ec2d324a2bb5b1ae954f374ba980a9cac7a979cf
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to