Get Pubsub bookmarks also if PEP is supported
This commit is contained in:
		
							parent
							
								
									149522dcee
								
							
						
					
					
						commit
						ac281533f5
					
				
					 1 changed files with 14 additions and 10 deletions
				
			
		|  | @ -2362,15 +2362,18 @@ class Connection(CommonConnection, ConnectionHandlers): | ||||||
|         """ |         """ | ||||||
|         if not app.account_is_connected(self.name): |         if not app.account_is_connected(self.name): | ||||||
|             return |             return | ||||||
|         if self.pubsub_supported and self.pubsub_publish_options_supported \ | 
 | ||||||
|                 and storage_type != 'xml': |         if storage_type != 'xml': | ||||||
|             self.send_pb_retrieve('', 'storage:bookmarks') |             pubsub = self.pubsub_supported or self.pep_supported | ||||||
|             app.log('bookmarks').info('Request Bookmarks (PubSub)') |             if pubsub and self.pubsub_publish_options_supported: | ||||||
|             # some server (ejabberd) are so slow to answer that we request via XML |                 self.send_pb_retrieve('', 'storage:bookmarks') | ||||||
|             # if we don't get answer in the next 30 seconds |                 app.log('bookmarks').info('Request Bookmarks (PubSub)') | ||||||
|             app.idlequeue.set_alarm(self._check_bookmarks_received, 30) |                 # some server (ejabberd) are so slow to answer that we | ||||||
|         else: |                 # request via XML if we don't get answer in the next 30 seconds | ||||||
|             self._request_bookmarks_xml() |                 app.idlequeue.set_alarm(self._check_bookmarks_received, 30) | ||||||
|  |                 return | ||||||
|  | 
 | ||||||
|  |         self._request_bookmarks_xml() | ||||||
| 
 | 
 | ||||||
|     def get_bookmarks_storage_node(self): |     def get_bookmarks_storage_node(self): | ||||||
|         NS_GAJIM_BM = 'xmpp:gajim.org/bookmarks' |         NS_GAJIM_BM = 'xmpp:gajim.org/bookmarks' | ||||||
|  | @ -2423,7 +2426,8 @@ class Connection(CommonConnection, ConnectionHandlers): | ||||||
|         storage_node = self.get_bookmarks_storage_node() |         storage_node = self.get_bookmarks_storage_node() | ||||||
| 
 | 
 | ||||||
|         if storage_type != 'xml': |         if storage_type != 'xml': | ||||||
|             if self.pubsub_supported and self.pubsub_publish_options_supported: |             pubsub = self.pubsub_supported or self.pep_supported | ||||||
|  |             if pubsub and self.pubsub_publish_options_supported: | ||||||
|                 self.send_pb_publish( |                 self.send_pb_publish( | ||||||
|                     '', 'storage:bookmarks', storage_node, 'current', |                     '', 'storage:bookmarks', storage_node, 'current', | ||||||
|                     options=self.get_bookmark_publish_options()) |                     options=self.get_bookmark_publish_options()) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue