Philipp Hörist pushed to branch master at gajim / gajim

Commits:
a754c059 by Philipp Hörist at 2017-07-19T20:19:40+02:00
Fix discovery of MAM

- - - - -
5e1e4e27 by Philipp Hörist at 2017-07-20T01:58:08+02:00
Fix multiple metacontact requests at startup

_continue_connection_request_privacy() should only trigger
once after we received the discoinfo on the hostname.

We do a discoinfo on all items that the server offers,
_continue_connection_request_privacy() was triggered on every received
discoinfo again, hence requesting metacontacts and delimiters again.

also _continue_connection_request_privacy() was called on every
discoinfo error, instead of only on a hostname discoinfo error.

This bug is only triggered if the server doesnt support privacy rules.

- - - - -
96cbed4f by Philipp Hörist at 2017-07-20T01:58:41+02:00
Remove redundant source_remove()

We remove the source in _schedule_activity_timers()

- - - - -


2 changed files:

- gajim/chat_control.py
- gajim/common/connection.py


Changes:

=====================================
gajim/chat_control.py
=====================================
--- a/gajim/chat_control.py
+++ b/gajim/chat_control.py
@@ -910,8 +910,6 @@ class ChatControl(ChatControlBase):
                 chatstate_to_send = 'active'
                 contact.our_chatstate = 'active'
 
-                GLib.source_remove(self.possible_paused_timeout_id)
-                GLib.source_remove(self.possible_inactive_timeout_id)
                 self._schedule_activity_timers()
 
         def _on_sent(obj, msg_stanza, message, encrypted, xhtml, label):


=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -1811,8 +1811,10 @@ class Connection(CommonConnection, ConnectionHandlers):
         # If we are not resuming, we ask for discovery info
         # and archiving preferences
         if not self.sm.supports_sm or (not self.sm.resuming and 
self.sm.enabled):
-            self.discoverInfo(gajim.config.get_per('accounts', self.name,
-                'hostname'), id_prefix='Gajim_')
+            our_jid = gajim.get_jid_from_account(self.name)
+            our_server = gajim.config.get_per('accounts', self.name, 
'hostname')
+            self.discoverInfo(our_jid, id_prefix='Gajim_')
+            self.discoverInfo(our_server, id_prefix='Gajim_')
 
         self.sm.resuming = False # back to previous state
         # Discover Stun server(s)
@@ -1865,7 +1867,8 @@ class Connection(CommonConnection, ConnectionHandlers):
     def _nec_agent_info_error_received(self, obj):
         if obj.conn.name != self.name:
             return
-        if obj.id_[:6] == 'Gajim_':
+        hostname = gajim.config.get_per('accounts', self.name, 'hostname')
+        if obj.id_[:6] == 'Gajim_' and obj.fjid == hostname:
             self._continue_connection_request_privacy()
 
     def _nec_agent_info_received(self, obj):
@@ -1891,6 +1894,19 @@ class Connection(CommonConnection, ConnectionHandlers):
         if obj.id_[:6] == 'Gajim_':
             hostname = gajim.config.get_per('accounts', self.name, 'hostname')
             our_jid = gajim.get_jid_from_account(self.name)
+
+            if obj.fjid == our_jid:
+                if nbxmpp.NS_MAM_2 in obj.features:
+                    self.archiving_namespace = nbxmpp.NS_MAM_2
+                elif nbxmpp.NS_MAM_1 in obj.features:
+                    self.archiving_namespace = nbxmpp.NS_MAM_1
+                elif nbxmpp.NS_MAM in obj.features:
+                    self.archiving_namespace = nbxmpp.NS_MAM
+                if self.archiving_namespace:
+                    self.archiving_supported = True
+                    self.archiving_313_supported = True
+                    get_action(self.name + '-archive').set_enabled(True)
+
             if obj.fjid == hostname:
                 if nbxmpp.NS_GMAILNOTIFY in obj.features:
                     gajim.gmail_domains.append(obj.fjid)
@@ -1915,16 +1931,6 @@ class Connection(CommonConnection, ConnectionHandlers):
                         # Remove stored bookmarks accessible to everyone.
                         self.send_pb_purge(our_jid, 'storage:bookmarks')
                         self.send_pb_delete(our_jid, 'storage:bookmarks')
-                if nbxmpp.NS_MAM_2 in obj.features:
-                    self.archiving_namespace = nbxmpp.NS_MAM_2
-                elif nbxmpp.NS_MAM_1 in obj.features:
-                    self.archiving_namespace = nbxmpp.NS_MAM_1
-                elif nbxmpp.NS_MAM in obj.features:
-                    self.archiving_namespace = nbxmpp.NS_MAM
-                if self.archiving_namespace:
-                    self.archiving_supported = True
-                    self.archiving_313_supported = True
-                    get_action(self.name + '-archive').set_enabled(True)
                 if nbxmpp.NS_ARCHIVE in obj.features:
                     self.archiving_supported = True
                     self.archiving_136_supported = True
@@ -1952,6 +1958,8 @@ class Connection(CommonConnection, ConnectionHandlers):
                     self.privacy_rules_supported = True
                     get_action(self.name + '-privacylists').set_enabled(True)
 
+                self._continue_connection_request_privacy()
+
             if nbxmpp.NS_BYTESTREAM in obj.features and \
             gajim.config.get_per('accounts', self.name, 'use_ft_proxies'):
                 our_fjid = helpers.parse_jid(our_jid + '/' + \
@@ -1968,7 +1976,6 @@ class Connection(CommonConnection, ConnectionHandlers):
                     self.available_transports[transport_type].append(obj.fjid)
                 else:
                     self.available_transports[transport_type] = [obj.fjid]
-            self._continue_connection_request_privacy()
 
     def send_custom_status(self, show, msg, jid):
         if not show in gajim.SHOW_LIST:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/47c33bbe392fbdc54dfb898203a45eb026ea5c7f...96cbed4fe78949e7553b62c50dc6165222a3cb38
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to