comparison sat/plugins/plugin_xep_0277.py @ 4018:86efd854dee1

plugin XEP-0277: ensure that `max-items` is set to `max` when creating a node
author Goffi <goffi@goffi.org>
date Mon, 20 Mar 2023 12:01:13 +0100
parents 74d4c9ff893d
children d8a1219e913f
comparison
equal deleted inserted replaced
4017:4a2c261646b6 4018:86efd854dee1
850 parent_node_config = await self._p.getConfiguration(client, service, node) 850 parent_node_config = await self._p.getConfiguration(client, service, node)
851 access = parent_node_config.get(self._p.OPT_ACCESS_MODEL, self._p.ACCESS_OPEN) 851 access = parent_node_config.get(self._p.OPT_ACCESS_MODEL, self._p.ACCESS_OPEN)
852 852
853 options = { 853 options = {
854 self._p.OPT_ACCESS_MODEL: access, 854 self._p.OPT_ACCESS_MODEL: access,
855 self._p.OPT_MAX_ITEMS: "max",
855 self._p.OPT_PERSIST_ITEMS: 1, 856 self._p.OPT_PERSIST_ITEMS: 1,
856 self._p.OPT_DELIVER_PAYLOADS: 1, 857 self._p.OPT_DELIVER_PAYLOADS: 1,
857 self._p.OPT_SEND_ITEM_SUBSCRIBE: 1, 858 self._p.OPT_SEND_ITEM_SUBSCRIBE: 1,
858 # FIXME: would it make sense to restrict publish model to subscribers? 859 # FIXME: would it make sense to restrict publish model to subscribers?
859 self._p.OPT_PUBLISH_MODEL: self._p.ACCESS_OPEN, 860 self._p.OPT_PUBLISH_MODEL: self._p.ACCESS_OPEN,
1244 #  FIXME: check if this mehtod is need, deprecate it if not 1245 #  FIXME: check if this mehtod is need, deprecate it if not
1245 client = self.host.getClient(profile_key) 1246 client = self.host.getClient(profile_key)
1246 1247
1247 _options = { 1248 _options = {
1248 self._p.OPT_ACCESS_MODEL: access, 1249 self._p.OPT_ACCESS_MODEL: access,
1250 self._p.OPT_MAX_ITEMS: "max",
1249 self._p.OPT_PERSIST_ITEMS: 1, 1251 self._p.OPT_PERSIST_ITEMS: 1,
1250 self._p.OPT_DELIVER_PAYLOADS: 1, 1252 self._p.OPT_DELIVER_PAYLOADS: 1,
1251 self._p.OPT_SEND_ITEM_SUBSCRIBE: 1, 1253 self._p.OPT_SEND_ITEM_SUBSCRIBE: 1,
1252 } 1254 }
1253 1255