we are now warned when we are disconnected from a server
This commit is contained in:
parent
02b74ceed4
commit
74f0e11948
|
@ -122,6 +122,7 @@ class Connection:
|
||||||
self.gpg = None
|
self.gpg = None
|
||||||
self.status = ''
|
self.status = ''
|
||||||
self.myVCardID = []
|
self.myVCardID = []
|
||||||
|
self.on_purpose = False
|
||||||
self.password = gajim.config.get_per('accounts', name, 'password')
|
self.password = gajim.config.get_per('accounts', name, 'password')
|
||||||
if USE_GPG:
|
if USE_GPG:
|
||||||
self.gpg = GnuPG.GnuPG()
|
self.gpg = GnuPG.GnuPG()
|
||||||
|
@ -301,10 +302,14 @@ class Connection:
|
||||||
def _disconnectedCB(self):
|
def _disconnectedCB(self):
|
||||||
"""Called when we are disconnected"""
|
"""Called when we are disconnected"""
|
||||||
gajim.log.debug('disconnectedCB')
|
gajim.log.debug('disconnectedCB')
|
||||||
if self.connection:
|
if not self.connection:
|
||||||
self.connected = 0
|
return
|
||||||
self.dispatch('STATUS', 'offline')
|
self.connected = 0
|
||||||
self.connection = None
|
self.dispatch('STATUS', 'offline')
|
||||||
|
self.connection = None
|
||||||
|
if not self.on_purpose:
|
||||||
|
self.dispatch('ERROR', 'You have been disconected from %s' & self.name)
|
||||||
|
self.on_purpose = False
|
||||||
# END disconenctedCB
|
# END disconenctedCB
|
||||||
|
|
||||||
def _rosterSetCB(self, con, iq_obj):
|
def _rosterSetCB(self, con, iq_obj):
|
||||||
|
@ -654,6 +659,7 @@ class Connection:
|
||||||
elif show == 'offline' and self.connected:
|
elif show == 'offline' and self.connected:
|
||||||
self.connected = 0
|
self.connected = 0
|
||||||
if self.connection:
|
if self.connection:
|
||||||
|
self.on_purpose = True
|
||||||
p = common.xmpp.Presence(typ = 'unavailable')
|
p = common.xmpp.Presence(typ = 'unavailable')
|
||||||
if msg:
|
if msg:
|
||||||
p.setStatus(msg)
|
p.setStatus(msg)
|
||||||
|
|
Loading…
Reference in New Issue