Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
ce09c90e by Philipp Hörist at 2025-10-18T22:05:08+02:00
cq: Discovery: Fix dataform type hints
- - - - -
2 changed files:
- nbxmpp/modules/discovery.py
- nbxmpp/structs.py
Changes:
=====================================
nbxmpp/modules/discovery.py
=====================================
@@ -15,6 +15,8 @@ from nbxmpp.errors import MalformedStanzaError
from nbxmpp.errors import StanzaError
from nbxmpp.modules.base import BaseModule
from nbxmpp.modules.dataforms import extend_form
+from nbxmpp.modules.dataforms import MultipleDataForm
+from nbxmpp.modules.dataforms import SimpleDataForm
from nbxmpp.namespaces import Namespace
from nbxmpp.protocol import ERR_ITEM_NOT_FOUND
from nbxmpp.protocol import ErrorNode
@@ -81,7 +83,7 @@ class Discovery(BaseModule):
def parse_disco_info(stanza: Iq, timestamp: float | None = None) -> DiscoInfo:
identities: list[DiscoIdentity] = []
features: list[str] = []
- dataforms = []
+ dataforms: list[SimpleDataForm | MultipleDataForm] = []
if timestamp is None:
timestamp = time.time()
=====================================
nbxmpp/structs.py
=====================================
@@ -43,7 +43,8 @@ from nbxmpp.const import StatusCode
from nbxmpp.language import LanguageMap
from nbxmpp.language import LanguageRange
from nbxmpp.language import LanguageTag
-from nbxmpp.modules.dataforms import DataForm
+from nbxmpp.modules.dataforms import MultipleDataForm
+from nbxmpp.modules.dataforms import SimpleDataForm
from nbxmpp.modules.fallback import FallbacksForT
from nbxmpp.modules.fallback import strip_fallback
from nbxmpp.namespaces import Namespace
@@ -451,7 +452,7 @@ class DiscoInfo(NamedTuple):
stanza: Iq | None
identities: list[DiscoIdentity]
features: list[str]
- dataforms: list[DataForm]
+ dataforms: list[SimpleDataForm | MultipleDataForm]
timestamp: float | None = None
def get_caps_hash(self) -> str | None:
View it on GitLab:
https://dev.gajim.org/gajim/python-nbxmpp/-/commit/ce09c90e76c4e88224aed69fb5deb6c7a56507e5
--
View it on GitLab:
https://dev.gajim.org/gajim/python-nbxmpp/-/commit/ce09c90e76c4e88224aed69fb5deb6c7a56507e5
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]