plugins import, tickets import, bugzilla import: comments handling:

- comments are put in "comments" key in import data, it's a list of microblog data
- in resulting item, the comments uri is put in comments_uri field
- (plugin import) root_service and root_node are kept in session
- (plugin ticket) reporter name is now in "reporter" key instead of "reporter_name"
- (plugin bugizlla): if not reporter name is found, first part of email address is used
This commit is contained in:
Goffi 2017-10-20 08:48:41 +02:00
commit 08a14fa4ac

View file

@ -662,12 +662,9 @@ class XEP_0277(object):
@param access: Node access model, according to xep-0060 #4.5
@param profile_key: profile key
"""
# FIXME: check if this mehtod is needed, deprecate it if not
client = self.host.getClient(profile_key)
_jid, xmlstream = self.host.getJidNStream(profile_key)
if not _jid:
log.error(_(u"Can't find profile's jid"))
return
_options = {self._p.OPT_ACCESS_MODEL: access, 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}
def cb(result):
@ -683,17 +680,17 @@ class XEP_0277(object):
#If the node already exists, the condition is "conflict",
#else we have an unmanaged error
if s_error.value.condition == 'conflict':
#d = self.host.plugins["XEP-0060"].deleteNode(client, _jid.userhostJID(), NS_MICROBLOG)
#d = self.host.plugins["XEP-0060"].deleteNode(client, client.jid.userhostJID(), NS_MICROBLOG)
#d.addCallback(lambda x: create_node().addCallback(cb).addErrback(fatal_err))
change_node_options().addCallback(cb).addErrback(fatal_err)
else:
fatal_err(s_error)
def create_node():
return self._p.createNode(client, _jid.userhostJID(), NS_MICROBLOG, _options)
return self._p.createNode(client, client.jid.userhostJID(), NS_MICROBLOG, _options)
def change_node_options():
return self._p.setOptions(_jid.userhostJID(), NS_MICROBLOG, _jid.userhostJID(), _options, profile_key=profile_key)
return self._p.setOptions(client.jid.userhostJID(), NS_MICROBLOG, client.jid.userhostJID(), _options, profile_key=profile_key)
create_node().addCallback(cb).addErrback(err_cb)