Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
d6c57d16 by wurstsalat at 2023-06-16T11:18:55+02:00
fix: Gateway: Fix roster method call
- - - - -
9ab73a0b by wurstsalat at 2023-06-16T11:24:43+02:00
cq: Contacts: Improve contact settings type annotations
- - - - -
2 changed files:
- gajim/common/modules/contacts.py
- gajim/common/modules/gateway.py
Changes:
=====================================
gajim/common/modules/contacts.py
=====================================
@@ -42,6 +42,10 @@
from gajim.common.helpers import Observable
from gajim.common.modules.base import BaseModule
from gajim.common.modules.util import LogAdapter
+from gajim.common.setting_values import AllContactSettings
+from gajim.common.setting_values import AllContactSettingsT
+from gajim.common.setting_values import AllGroupChatSettings
+from gajim.common.setting_values import AllGroupChatSettingsT
from gajim.common.setting_values import BoolContactSettings
from gajim.common.setting_values import BoolGroupChatSettings
from gajim.common.setting_values import IntGroupChatSettings
@@ -63,7 +67,7 @@ def get(self, setting: StringContactSettings) -> str: ... #
noqa: E704
@overload
def get(self, setting: BoolContactSettings) -> bool: ... # noqa: E704
- def get(self, setting: Any) -> Any:
+ def get(self, setting: AllContactSettings) -> AllContactSettingsT:
return app.settings.get_contact_setting(
self._account, self._jid, setting)
@@ -89,7 +93,7 @@ def get(self, setting: BoolGroupChatSettings) -> bool: ... #
noqa: E704
@overload
def get(self, setting: IntGroupChatSettings) -> int: ... # noqa: E704
- def get(self, setting: Any) -> Any:
+ def get(self, setting: AllGroupChatSettings) -> AllGroupChatSettingsT:
return app.settings.get_group_chat_setting(
self._account, self._jid, setting)
=====================================
gajim/common/modules/gateway.py
=====================================
@@ -19,6 +19,7 @@
import nbxmpp
from nbxmpp.namespaces import Namespace
from nbxmpp.protocol import Iq
+from nbxmpp.protocol import JID
from gajim.common import app
from gajim.common import types
@@ -50,8 +51,8 @@ def _on_unsubscribe_result(self,
return
agent = stanza.getFrom().bare
- jid_list = []
- for contact in self._client.get_module('Roster').iter_contacts:
+ jid_list: list[JID] = []
+ for contact in self._client.get_module('Roster').iter_contacts():
if contact.jid.domain == agent:
jid_list.append(contact.jid)
self._log.info(
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/025c05bf8a3405131a2d9a67f6a4cf4c6e22af96...9ab73a0b5a2e34cd0229123f7cefa0774e2c8f32
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/025c05bf8a3405131a2d9a67f6a4cf4c6e22af96...9ab73a0b5a2e34cd0229123f7cefa0774e2c8f32
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]