diff src/plugins/plugin_xep_0277.py @ 745:812dc38c0094

plugins groupblog (xep-0060, xep-0277): added blog item modification/deletion
author souliane <souliane@mailoo.org>
date Tue, 10 Dec 2013 09:02:20 +0100
parents 890fbf2d7fdd
children 64dd7c0f4feb
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0277.py	Mon Dec 09 15:31:07 2013 +0100
+++ b/src/plugins/plugin_xep_0277.py	Tue Dec 10 09:02:20 2013 +0100
@@ -173,7 +173,8 @@
         _entry.author = atom.Author()
         _entry.author.name = data.get('author', self.host.getJidNStream(profile)[0].userhost()).encode('utf-8')
         _entry.updated = float(data.get('timestamp', time()))
-        _entry.id = str(_uuid)
+        entry_id = data.get('id', str(_uuid))
+        _entry.id = entry_id
         if 'comments' in data:
             link = atom.Link()
             link.attrs['href'] = data['comments']
@@ -181,8 +182,7 @@
             link.attrs['title'] = 'comments'
             _entry.links.append(link)
         _entry_elt = ElementParser()(str(_entry).decode('utf-8'))
-        item = pubsub.Item(payload=_entry_elt)
-        item['id'] = _uuid
+        item = pubsub.Item(id=entry_id, payload=_entry_elt)
         defer.returnValue(item)
 
     @defer.inlineCallbacks