do not set an id when we publish a new item on pubsub. Fixes #6947
This commit is contained in:
		
							parent
							
								
									8a82e9021f
								
							
						
					
					
						commit
						8520bc8c18
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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())])
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue