annotate sat/plugins/plugin_misc_lists.py @ 3459:8dc26e5edcd3

plugin tickets, merge_requests: renamed "tickets" feature to "lists": this feature is more generic than only "tickets" for technical stuff, thus the name "lists" seems more appropriate.
author Goffi <goffi@goffi.org>
date Thu, 04 Feb 2021 21:05:21 +0100
parents sat/plugins/plugin_misc_tickets.py@b68346a52920
children d4a71a1dac88
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
1 #!/usr/bin/env python3
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
2
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
3 # Copyright (C) 2009-2020 Jérôme Poisson (goffi@goffi.org)
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
4
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # This program is free software: you can redistribute it and/or modify
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # it under the terms of the GNU Affero General Public License as published by
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # the Free Software Foundation, either version 3 of the License, or
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # (at your option) any later version.
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
9
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # This program is distributed in the hope that it will be useful,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # GNU Affero General Public License for more details.
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
14
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # You should have received a copy of the GNU Affero General Public License
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
17
3459
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
18 from sat.core.i18n import _, D_
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
19 from sat.core.constants import Const as C
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
20 from twisted.internet import defer
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
21 from sat.tools.common import uri
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
22 import shortuuid
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
23 from sat.core.log import getLogger
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
24
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
25 log = getLogger(__name__)
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
26
3459
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
27 # XXX: this plugin was formely named "tickets", thus the namespace keeps this
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
28 # name
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
29 APP_NS_TICKETS = "org.salut-a-toi.tickets:0"
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
30
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
31 PLUGIN_INFO = {
3459
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
32 C.PI_NAME: _("Pubsub Lists"),
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
33 C.PI_IMPORT_NAME: "LISTS",
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
34 C.PI_TYPE: "EXP",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
35 C.PI_PROTOCOLS: [],
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
36 C.PI_DEPENDENCIES: ["XEP-0060", "XEP-0346", "XEP-0277", "IDENTITY"],
3459
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
37 C.PI_MAIN: "PubsubLists",
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
38 C.PI_HANDLER: "no",
3459
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
39 C.PI_DESCRIPTION: _("""Pubsub lists management plugin"""),
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
40 }
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
41
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
42
3459
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
43 class PubsubLists:
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
44
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
45 def __init__(self, host):
3459
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
46 log.info(_("Pubsub lists plugin initialization"))
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
47 self.host = host
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
48 self._s = self.host.plugins["XEP-0346"]
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
49 self.namespace = self._s.getSubmittedNS(APP_NS_TICKETS)
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
50 host.registerNamespace("tickets", self.namespace)
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
51 self._p = self.host.plugins["XEP-0060"]
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
52 self._m = self.host.plugins["XEP-0277"]
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
53 host.bridge.addMethod(
3459
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
54 "listGet",
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
55 ".plugin",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
56 in_sign="ssiassa{ss}s",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
57 out_sign="s",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
58 method=lambda service, node, max_items, items_ids, sub_id, extra, profile_key:
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
59 self._s._get(
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
60 service,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
61 node,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
62 max_items,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
63 items_ids,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
64 sub_id,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
65 extra,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
66 default_node=self.namespace,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
67 form_ns=APP_NS_TICKETS,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
68 filters={
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
69 "author": self._s.valueOrPublisherFilter,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
70 "created": self._s.dateFilter,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
71 "updated": self._s.dateFilter,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
72 },
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
73 profile_key=profile_key),
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
74 async_=True,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
75 )
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
76 host.bridge.addMethod(
3459
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
77 "listSet",
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
78 ".plugin",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
79 in_sign="ssa{sas}ssss",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
80 out_sign="s",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
81 method=self._set,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
82 async_=True,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
83 )
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
84 host.bridge.addMethod(
3459
8dc26e5edcd3 plugin tickets, merge_requests: renamed "tickets" feature to "lists":
Goffi <goffi@goffi.org>
parents: 3458
diff changeset
85 "listSchemaGet",
3458
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
86 ".plugin",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
87 in_sign="sss",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
88 out_sign="s",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
89 method=lambda service, nodeIdentifier, profile_key: self._s._getUISchema(
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
90 service, nodeIdentifier, default_node=self.namespace,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
91 profile_key=profile_key),
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
92 async_=True,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
93 )
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
94
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
95 def _set(self, service, node, values, schema=None, item_id=None, extra='',
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
96 profile_key=C.PROF_KEY_NONE):
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
97 client, service, node, schema, item_id, extra = self._s.prepareBridgeSet(
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
98 service, node, schema, item_id, extra, profile_key
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
99 )
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
100 d = defer.ensureDeferred(self.set(
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
101 client, service, node, values, schema, item_id, extra, deserialise=True
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
102 ))
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
103 d.addCallback(lambda ret: ret or "")
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
104 return d
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
105
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
106 async def set(self, client, service, node, values, schema=None, item_id=None, extra=None,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
107 deserialise=False, form_ns=APP_NS_TICKETS):
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
108 """Publish a tickets
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
109
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
110 @param node(unicode, None): Pubsub node to use
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
111 None to use default tickets node
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
112 @param values(dict[key(unicode), [iterable[object]|object]]): values of the ticket
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
113
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
114 if value is not iterable, it will be put in a list
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
115 'created' and 'updated' will be forced to current time:
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
116 - 'created' is set if item_id is None, i.e. if it's a new ticket
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
117 - 'updated' is set everytime
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
118 @param extra(dict, None): same as for [XEP-0060.sendItem] with additional keys:
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
119 - update(bool): if True, get previous item data to merge with current one
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
120 if True, item_id must be None
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
121 other arguments are same as for [self._s.sendDataFormItem]
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
122 @return (unicode): id of the created item
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
123 """
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
124 if not node:
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
125 node = self.namespace
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
126
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
127 if not item_id:
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
128 comments_service = await self._m.getCommentsService(client, service)
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
129
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
130 # we need to use uuid for comments node, because we don't know item id in
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
131 # advance (we don't want to set it ourselves to let the server choose, so we
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
132 # can have a nicer id if serial ids is activated)
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
133 comments_node = self._m.getCommentsNode(
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
134 node + "_" + str(shortuuid.uuid())
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
135 )
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
136 options = {
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
137 self._p.OPT_ACCESS_MODEL: self._p.ACCESS_OPEN,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
138 self._p.OPT_PERSIST_ITEMS: 1,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
139 self._p.OPT_MAX_ITEMS: -1,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
140 self._p.OPT_DELIVER_PAYLOADS: 1,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
141 self._p.OPT_SEND_ITEM_SUBSCRIBE: 1,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
142 self._p.OPT_PUBLISH_MODEL: self._p.ACCESS_OPEN,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
143 }
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
144 await self._p.createNode(client, comments_service, comments_node, options)
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
145 values["comments_uri"] = uri.buildXMPPUri(
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
146 "pubsub",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
147 subtype="microblog",
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
148 path=comments_service.full(),
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
149 node=comments_node,
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
150 )
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
151
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
152 return await self._s.set(
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
153 client, service, node, values, schema, item_id, extra, deserialise, form_ns
b68346a52920 Backed out changeset 6deea0d8d0e7
Goffi <goffi@goffi.org>
parents:
diff changeset
154 )