plugin XEP-0277: minor id generation change
This commit is contained in:
parent
f5f25e8ab5
commit
06d5346714
1 changed files with 1 additions and 4 deletions
|
|
@ -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 ##
|
||||
|
|
|
|||
Loading…
Reference in a new issue