Mercurial > libervia-backend
comparison libervia/backend/plugins/plugin_xep_0060.py @ 4334:111dce64dcb5
plugins XEP-0300, XEP-0446, XEP-0447, XEP0448 and others: Refactoring to use Pydantic:
Pydantic models are used more and more in Libervia, for the bridge API, and also to
convert `domish.Element` to internal representation.
Type hints have also been added in many places.
rel 453
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 03 Dec 2024 00:12:38 +0100 |
parents | 554a87ae17a6 |
children |
comparison
equal
deleted
inserted
replaced
4333:e94799a0908f | 4334:111dce64dcb5 |
---|---|
709 async def publish( | 709 async def publish( |
710 self, | 710 self, |
711 client: SatXMPPEntity, | 711 client: SatXMPPEntity, |
712 service: jid.JID, | 712 service: jid.JID, |
713 nodeIdentifier: str, | 713 nodeIdentifier: str, |
714 items: list[pubsub.Item]|None = None, | 714 items: list[pubsub.Item] | None = None, |
715 options: dict|None = None, | 715 options: dict | None = None, |
716 sender: jid.JID|None = None, | 716 sender: jid.JID | None = None, |
717 extra: dict[str, Any]|None = None, | 717 extra: dict[str, Any] | None = None, |
718 ) -> domish.Element: | 718 ) -> domish.Element: |
719 """Publish pubsub items | 719 """Publish pubsub items |
720 | 720 |
721 @param sender: sender of the request, | 721 @param sender: sender of the request, |
722 client.jid will be used if not set | 722 client.jid will be used if not set |
805 return d | 805 return d |
806 | 806 |
807 async def get_items( | 807 async def get_items( |
808 self, | 808 self, |
809 client: SatXMPPEntity, | 809 client: SatXMPPEntity, |
810 service: jid.JID|None, | 810 service: jid.JID | None, |
811 node: str, | 811 node: str, |
812 max_items: int|None = None, | 812 max_items: int | None = None, |
813 item_ids: list[str]|None = None, | 813 item_ids: list[str] | None = None, |
814 sub_id: str|None = None, | 814 sub_id: str | None = None, |
815 rsm_request: rsm.RSMRequest|None = None, | 815 rsm_request: rsm.RSMRequest | None = None, |
816 extra: dict|None = None, | 816 extra: dict | None = None, |
817 ) -> tuple[list[domish.Element], dict]: | 817 ) -> tuple[list[domish.Element], dict]: |
818 """Retrieve pubsub items from a node. | 818 """Retrieve pubsub items from a node. |
819 | 819 |
820 @param service: pubsub service. | 820 @param service: pubsub service. |
821 @param node: node id. | 821 @param node: node id. |