Mercurial > libervia-backend
comparison libervia/backend/plugins/plugin_xep_0376.py @ 4327:554a87ae17a6
plugin XEP-0048, XEP-0402; CLI (bookmarks): implement XEP-0402 (PEP Native Bookmarks):
- Former bookmarks implementation is now labeled as "legacy".
- XEP-0402 is now used for bookmarks when relevant namespaces are found, and it fallbacks
to legacy XEP-0048/XEP-0049 bookmarks otherwise.
- CLI legacy bookmark commands have been moved to `bookmarks legacy`
- CLI bookmarks commands now use the new XEP-0402 (with fallback to legacy one
automatically used if necessary).
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 20 Nov 2024 11:43:27 +0100 |
parents | 9658c534287e |
children |
comparison
equal
deleted
inserted
replaced
4326:5fd6a4dc2122 | 4327:554a87ae17a6 |
---|---|
103 service: jid.JID, | 103 service: jid.JID, |
104 nodeIdentifier: str, | 104 nodeIdentifier: str, |
105 sub_jid: Optional[jid.JID] = None, | 105 sub_jid: Optional[jid.JID] = None, |
106 options: Optional[dict] = None, | 106 options: Optional[dict] = None, |
107 ) -> Tuple[bool, Optional[pubsub.Subscription]]: | 107 ) -> Tuple[bool, Optional[pubsub.Subscription]]: |
108 if not await self.host.memory.disco.has_feature(client, NS_PAM) or client.is_component: | 108 if ( |
109 not await self.host.memory.disco.has_feature(client, NS_PAM) | |
110 or client.is_component | |
111 ): | |
109 return True, None | 112 return True, None |
110 | 113 |
111 await self._sub_request(client, service, nodeIdentifier, sub_jid, options, True) | 114 await self._sub_request(client, service, nodeIdentifier, sub_jid, options, True) |
112 | 115 |
113 # TODO: actual result is sent with <message> stanza, we have to get and use them | 116 # TODO: actual result is sent with <message> stanza, we have to get and use them |
125 nodeIdentifier: str, | 128 nodeIdentifier: str, |
126 sub_jid: Optional[jid.JID], | 129 sub_jid: Optional[jid.JID], |
127 subscriptionIdentifier: Optional[str], | 130 subscriptionIdentifier: Optional[str], |
128 sender: Optional[jid.JID] = None, | 131 sender: Optional[jid.JID] = None, |
129 ) -> bool: | 132 ) -> bool: |
130 if not await self.host.memory.disco.has_feature(client, NS_PAM) or client.is_component: | 133 if ( |
134 not await self.host.memory.disco.has_feature(client, NS_PAM) | |
135 or client.is_component | |
136 ): | |
131 return True | 137 return True |
132 await self._sub_request(client, service, nodeIdentifier, sub_jid, None, False) | 138 await self._sub_request(client, service, nodeIdentifier, sub_jid, None, False) |
133 return False | 139 return False |
134 | 140 |
135 async def subscriptions( | 141 async def subscriptions( |