comparison sat/core/sat_main.py @ 2886:b06cb71079fa

core (xmpp): new networkEnabled() and networkDisabled() methods: those methods can be called by platform specific plugins when network is known to be (un)available. This way, connection attempts can be cancelled when no network is available, saving resources (notably battery on mobile devices), or attempts can be restarted immediately when network is known to be available again.
author Goffi <goffi@goffi.org>
date Sat, 06 Apr 2019 19:05:57 +0200
parents 5ba98fd6c9a4
children 82b781c46841
comparison
equal deleted inserted replaced
2885:e9016bfd8cb2 2886:b06cb71079fa
416 if options is None: 416 if options is None:
417 options = {} 417 options = {}
418 418
419 def connectProfile(__=None): 419 def connectProfile(__=None):
420 if self.isConnected(profile): 420 if self.isConnected(profile):
421 log.info(_("already connected !")) 421 log.info(_(u"already connected !"))
422 return True 422 return True
423 423
424 if self.memory.isComponent(profile): 424 if self.memory.isComponent(profile):
425 d = xmpp.SatXMPPComponent.startConnection(self, profile, max_retries) 425 d = xmpp.SatXMPPComponent.startConnection(self, profile, max_retries)
426 else: 426 else: