do not set an id when we publish a new item on pubsub. Fixes #6947

This commit is contained in:
Yann Leboulanger 2011-08-18 19:03:31 +02:00
parent 8a82e9021f
commit 8520bc8c18
2 changed files with 5 additions and 3 deletions

View File

@ -76,7 +76,7 @@ class ConnectionPubSub:
self.__callbacks[id_] = (cb, args, kwargs)
def send_pb_publish(self, jid, node, item, id_, options=None):
def send_pb_publish(self, jid, node, item, id_=None, options=None):
"""
Publish item to a node
"""
@ -85,7 +85,10 @@ class ConnectionPubSub:
query = xmpp.Iq('set', to=jid)
e = query.addChild('pubsub', namespace=xmpp.NS_PUBSUB)
p = e.addChild('publish', {'node': node})
p.addChild('item', {'id': id_}, [item])
attrs = {}
if id_:
attrs = {'id': id_}
p.addChild('item', attrs, [item])
if options:
p = e.addChild('publish-options')
p.addChild(node=options)

View File

@ -61,7 +61,6 @@ class GroupsPostWindow:
author.addChild('name', {}, [self.from_entry.get_text()])
item.addChild('generator', {}, ['Gajim'])
item.addChild('title', {}, [self.subject_entry.get_text()])
item.addChild('id', {}, ['0'])
buf = self.contents_textview.get_buffer()
item.addChild('content', {}, [buf.get_text(buf.get_start_iter(), buf.get_end_iter())])