Show
Ignore:
Timestamp:
08/31/07 09:56:38 (15 months ago)
Author:
asterix
Message:

fix reconnect feature with zeroconf. fixes #3068 and #3076

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/common/zeroconf/connection_zeroconf.py

    r8636 r8650  
    6565                self.call_resolve_timeout = False 
    6666                 
    67                 #self.time_to_reconnect = None 
     67                self.time_to_reconnect = None 
    6868                #self.new_account_info = None 
    6969                self.bookmarks = [] 
     
    128128 
    129129        def _reconnect(self): 
     130                # Do not try to reco while we are already trying 
     131                self.time_to_reconnect = None 
    130132                gajim.log.debug('reconnect') 
    131133 
     
    199201                self.status = 'offline' 
    200202                self.disconnect() 
     203 
     204        def _disconnectedReconnCB(self): 
     205                '''Called when we are disconnected. Comes from network manager for example 
     206                we don't try to reconnect, network manager will tell us when we can''' 
     207                log.debug('disconnectedReconnCB') 
     208                if gajim.account_is_connected(self.name): 
     209                        # we cannot change our status to offline or connecting 
     210                        # after we auth to server 
     211                        self.old_show = STATUS_LIST[self.connected] 
     212                self.connected = 0 
     213                self.dispatch('STATUS', 'offline') 
     214                # random number to show we wait network manager to send us a reconenct 
     215                self.time_to_reconnect = 5 
     216                self.on_purpose = False 
    201217 
    202218        def _on_name_conflictCB(self, alt_name): 
     
    301317                elif show == 'offline' and self.connected: 
    302318                        self.disconnect() 
     319                        self.time_to_reconnect = None 
    303320                         
    304321                # update status