Add docstring for _set_node_config

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-10-25 03:27:00 +02:00
parent 753c5de27c
commit 9096891e28
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -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]: