# HG changeset patch # User Goffi # Date 1509829801 -3600 # Node ID 59100136f07af622e33bfb5c1a90dffcb4fd3e5e # Parent 8b37a62336c34391002db8a3ada619a445a3423c plugin XEP-0277: minor id generation change diff -r 8b37a62336c3 -r 59100136f07a src/plugins/plugin_xep_0277.py --- a/src/plugins/plugin_xep_0277.py Fri Nov 03 14:31:42 2017 +0100 +++ b/src/plugins/plugin_xep_0277.py Sat Nov 04 22:10:01 2017 +0100 @@ -349,11 +349,8 @@ @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 @@ 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 ##