temporary fix for the Event dispatcher to work with TLS connections
This commit is contained in:
parent
bb0ba86b23
commit
54645ae409
1 changed files with 3 additions and 2 deletions
|
@ -1159,7 +1159,7 @@ class Connection:
|
||||||
self.last_incoming = time.time()
|
self.last_incoming = time.time()
|
||||||
self.keep_alive_sent = False
|
self.keep_alive_sent = False
|
||||||
|
|
||||||
def _event_dispatcher(self, realm, event, data):
|
def _event_dispatcher(self, realm, event, data):
|
||||||
if realm == common.xmpp.NS_REGISTER:
|
if realm == common.xmpp.NS_REGISTER:
|
||||||
if event == common.xmpp.features.REGISTER_DATA_RECEIVED:
|
if event == common.xmpp.features.REGISTER_DATA_RECEIVED:
|
||||||
# data is (agent, DataFrom)
|
# data is (agent, DataFrom)
|
||||||
|
@ -1299,7 +1299,8 @@ class Connection:
|
||||||
self.dispatch('STATUS', 'offline')
|
self.dispatch('STATUS', 'offline')
|
||||||
self.dispatch('ERROR', (_('Could not connect to "%s"') % self.name,
|
self.dispatch('ERROR', (_('Could not connect to "%s"') % self.name,
|
||||||
_('Check your connection or try again later')))
|
_('Check your connection or try again later')))
|
||||||
return None
|
return None
|
||||||
|
con.RegisterEventHandler(self._event_dispatcher)
|
||||||
if auth:
|
if auth:
|
||||||
con.initRoster()
|
con.initRoster()
|
||||||
self.last_incoming = time.time()
|
self.last_incoming = time.time()
|
||||||
|
|
Loading…
Add table
Reference in a new issue