plugin XEP-0277: minor id generation change

This commit is contained in:
Goffi 2017-11-04 22:10:01 +01:00
commit 06d5346714

View file

@ -349,11 +349,8 @@ class XEP_0277(object):
@param data: data dict as given by bridge method.
@param item_id(unicode, None): id of the item to use
if None the id will be generated randomly
@return: deferred which fire domish.Element
"""
if item_id is None:
item_id = unicode(uuid.uuid4())
client = self.host.getClient(profile)
entry_elt = domish.Element((NS_ATOM, 'entry'))
@ -444,7 +441,7 @@ class XEP_0277(object):
category_elt['term'] = tag
## id ##
entry_id = data.get('id', item_id) # FIXME: use a proper id (see XEP-0277 §7.1)
entry_id = data.get('id', item_id or unicode(uuid.uuid4())) # FIXME: use a proper id (see XEP-0277 §7.1)
entry_elt.addElement('id', content=entry_id) #
## comments ##