comparison src/plugins/plugin_misc_tickets.py @ 2434:7fa9456032e7

plugin tickets: specify parent service when using getCommentsService + fill reporter_jid is missing (will be discarded later if not in the schema)
author Goffi <goffi@goffi.org>
date Wed, 15 Nov 2017 08:58:38 +0100
parents 3faf18111d61
children 81a45e7886c9
comparison
equal deleted inserted replaced
2433:014feb75092d 2434:7fa9456032e7
162 if not node: 162 if not node:
163 node = NS_TICKETS 163 node = NS_TICKETS
164 now = utils.xmpp_date() 164 now = utils.xmpp_date()
165 if not item_id: 165 if not item_id:
166 values['created'] = now 166 values['created'] = now
167 comments_service = self._m.getCommentsService(client) 167 comments_service = yield self._m.getCommentsService(client, service)
168 168
169 # we need to use uuid for comments node, because we don't know item id in advance 169 # we need to use uuid for comments node, because we don't know item id in advance
170 # (we don't want to set it ourselves to let the server choose, so we can have 170 # (we don't want to set it ourselves to let the server choose, so we can have
171 # a nicer id if serial ids is activated) 171 # a nicer id if serial ids is activated)
172 comments_node = self._m.getCommentsNode(node + u'_' + unicode(shortuuid.uuid())) 172 comments_node = self._m.getCommentsNode(node + u'_' + unicode(shortuuid.uuid()))
182 182
183 values['updated'] = now 183 values['updated'] = now
184 if not values.get('reporter'): 184 if not values.get('reporter'):
185 identity = yield self._i.getIdentity(client, client.jid) 185 identity = yield self._i.getIdentity(client, client.jid)
186 values['reporter'] = identity['nick'] 186 values['reporter'] = identity['nick']
187 if not values.get('reporter_jid'):
188 values['reporter_jid'] = client.jid.full()
187 item_id = yield self._s.sendDataFormItem(client, service, node, values, schema, item_id, extra, deserialise) 189 item_id = yield self._s.sendDataFormItem(client, service, node, values, schema, item_id, extra, deserialise)
188 defer.returnValue(item_id) 190 defer.returnValue(item_id)
189 191
190 def _getSchema(self, service, node, profile_key=C.PROF_KEY_NONE): 192 def _getSchema(self, service, node, profile_key=C.PROF_KEY_NONE):
191 if not node: 193 if not node: