From 9096891e28268f4965d70c04ddad4ebd7cd3f81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Fri, 25 Oct 2019 03:27:00 +0200 Subject: [PATCH] Add docstring for _set_node_config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- slixmpp_omemo/__init__.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index 49957fe..1930369 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -252,6 +252,20 @@ class XEP_0384(BasePlugin): persist_items: bool = True, access_model: Optional[str] = None, ) -> asyncio.Future: + """ + Sets OMEMO devicelist or bundle node configuration. + + This function is meant to be used once we've tried publish options + and they came back with precondition-not-met. This means an + existing node is not using our defaults. + + This function will be overwriting pubsub#persist_items only, + leaving pubsub#access_model as it has already been set. + + To be complete, the code using this function should probably + set the bundle node to the same access_model as the devicelist + node. + """ form = Form() form['type'] = 'submit' form.add_field( @@ -331,6 +345,8 @@ class XEP_0384(BasePlugin): log.debug('The node we tried to publish was already ' 'existing with a different configuration. ' 'Trying to configure manually..') + # TODO: We should attempt setting this node to the same + # access_model as the devicelist node for completness. await self._set_node_config(OMEMO_BUNDLES_NS) async def _fetch_bundle(self, jid: str, device_id: int) -> Optional[ExtendedPublicBundle]: