plugins groupblog (xep-0060, xep-0277): added blog item modification/deletion

This commit is contained in:
souliane 2013-12-10 09:02:20 +01:00
commit 481bee01c2

View file

@ -173,7 +173,8 @@ class XEP_0277(object):
_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 @@ class XEP_0277(object):
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