Philipp Hörist pushed to branch master at gajim / gajim
Commits:
2 changed files:
Changes:
| ... | ... | @@ -35,6 +35,9 @@ |
| 35 | 35 |
from gajim.common.modules.util import event_node
|
| 36 | 36 |
|
| 37 | 37 |
|
| 38 |
+NODE_MAX_NS = 'http://jabber.org/protocol/pubsub#config-node-max'
|
|
| 39 |
+ |
|
| 40 |
+ |
|
| 38 | 41 |
class Bookmarks(BaseModule):
|
| 39 | 42 |
def __init__(self, con):
|
| 40 | 43 |
BaseModule.__init__(self, con)
|
| ... | ... | @@ -43,6 +46,7 @@ def __init__(self, con): |
| 43 | 46 |
self._conversion = False
|
| 44 | 47 |
self._compat = False
|
| 45 | 48 |
self._compat_pep = False
|
| 49 |
+ self._node_max = False
|
|
| 46 | 50 |
self._bookmarks = {}
|
| 47 | 51 |
self._join_timeouts = []
|
| 48 | 52 |
self._request_in_progress = True
|
| ... | ... | @@ -132,6 +136,7 @@ def _bookmark_1_event_received(self, _con, _stanza, properties): |
| 132 | 136 |
NetworkEvent('bookmarks-received', account=self._account))
|
| 133 | 137 |
|
| 134 | 138 |
def pass_disco(self, info):
|
| 139 |
+ self._node_max = NODE_MAX_NS in info.features
|
|
| 135 | 140 |
self._compat_pep = Namespace.BOOKMARKS_COMPAT_PEP in info.features
|
| 136 | 141 |
self._compat = Namespace.BOOKMARKS_COMPAT in info.features
|
| 137 | 142 |
self._conversion = Namespace.BOOKMARK_CONVERSION in info.features
|
| ... | ... | @@ -141,7 +146,10 @@ def _bookmark_module(self): |
| 141 | 146 |
if not self._con.get_module('PubSub').publish_options:
|
| 142 | 147 |
return 'PrivateBookmarks'
|
| 143 | 148 |
|
| 144 |
- if app.settings.get('dev_force_bookmark_2') or self._compat_pep:
|
|
| 149 |
+ if app.settings.get('dev_force_bookmark_2'):
|
|
| 150 |
+ return 'NativeBookmarks'
|
|
| 151 |
+ |
|
| 152 |
+ if self._compat_pep and self._node_max:
|
|
| 145 | 153 |
return 'NativeBookmarks'
|
| 146 | 154 |
|
| 147 | 155 |
if self._conversion:
|
| ... | ... | @@ -44,8 +44,9 @@ def __init__(self, con): |
| 44 | 44 |
self.publish_options = False
|
| 45 | 45 |
|
| 46 | 46 |
def pass_disco(self, info):
|
| 47 |
- self._log.info('Discovered Pubsub publish options: %s', info.jid)
|
|
| 48 |
- self.publish_options = True
|
|
| 47 |
+ if Namespace.PUBSUB_PUBLISH_OPTIONS in info.features:
|
|
| 48 |
+ self._log.info('Discovered Pubsub publish options: %s', info.jid)
|
|
| 49 |
+ self.publish_options = True
|
|
| 49 | 50 |
|
| 50 | 51 |
def send_pb_subscription_query(self, jid, cb, **kwargs):
|
| 51 | 52 |
if not app.account_is_available(self._account):
|