# HG changeset patch # User Goffi # Date 1509086122 -7200 # Node ID 8ed4ac10cb5e4d0de26e9b91cf428912d5d6e26a # Parent b29a53fb270db6bf0d5c42e43c622a001b17e5b9 plugin tickets import: create comments nodes with open access/publishing diff -r b29a53fb270d -r 8ed4ac10cb5e src/plugins/plugin_tickets_import.py --- a/src/plugins/plugin_tickets_import.py Fri Oct 27 08:33:48 2017 +0200 +++ b/src/plugins/plugin_tickets_import.py Fri Oct 27 08:35:22 2017 +0200 @@ -97,9 +97,17 @@ def importSubItems(self, client, item_import_data, ticket_data, session, options): # TODO: force "open" permission (except if private, check below) # TODO: handle "private" metadata, to have non public access for node + # TODO: node access/publish model should be customisable comments = ticket_data.get('comments', []) service, node = self._m.getCommentsService(client), self._m.getCommentsNode(session['root_node'] + u'_' + ticket_data['id']) - yield self._p.createIfNewNode(client, service, node) + node_options = {self._p.OPT_ACCESS_MODEL: self._p.ACCESS_OPEN, + self._p.OPT_PERSIST_ITEMS: 1, + self._p.OPT_MAX_ITEMS: -1, + self._p.OPT_DELIVER_PAYLOADS: 1, + self._p.OPT_SEND_ITEM_SUBSCRIBE: 1, + self._p.OPT_PUBLISH_MODEL: self._p.ACCESS_OPEN, + } + yield self._p.createIfNewNode(client, service, node, options=node_options) ticket_data['comments_uri'] = uri.buildXMPPUri(u'pubsub', subtype='microblog', path=service.full(), node=node) for comment in comments: if 'updated' not in comment and 'published' in comment: diff -r b29a53fb270d -r 8ed4ac10cb5e src/plugins/plugin_xep_0060.py --- a/src/plugins/plugin_xep_0060.py Fri Oct 27 08:33:48 2017 +0200 +++ b/src/plugins/plugin_xep_0060.py Fri Oct 27 08:35:22 2017 +0200 @@ -445,6 +445,7 @@ @param option(dict[unicode, unicode], None): node configuration options @return (unicode): identifier of the created node (may be different from requested name) """ + # TODO: if pubsub service doesn't hande publish-options, configure it in a second time return client.pubsub_client.createNode(service, nodeIdentifier, options) @defer.inlineCallbacks