Skip to content
Snippets Groups Projects
Commit fbe8c156 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Client: Use NetworkEvent instead of OurShowEvent

parent 995b0172
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
from gajim.common.i18n import _ from gajim.common.i18n import _
from gajim.common.connection_handlers import ConnectionHandlers from gajim.common.connection_handlers import ConnectionHandlers
from gajim.common.connection_handlers_events import OurShowEvent
from gajim.common.connection_handlers_events import MessageSentEvent from gajim.common.connection_handlers_events import MessageSentEvent
from gajim.gtk.util import open_window from gajim.gtk.util import open_window
...@@ -216,8 +215,8 @@ def process_ssl_errors(self): ...@@ -216,8 +215,8 @@ def process_ssl_errors(self):
def _on_resume_failed(self, _client, _signal_name): def _on_resume_failed(self, _client, _signal_name):
log.info('Resume failed') log.info('Resume failed')
app.nec.push_incoming_event(OurShowEvent( app.nec.push_incoming_event(NetworkEvent(
None, conn=self, show='offline')) 'our-show', conn=self, show='offline'))
self.get_module('Chatstate').enabled = False self.get_module('Chatstate').enabled = False
def _on_resume_successful(self, _client, _signal_name): def _on_resume_successful(self, _client, _signal_name):
...@@ -260,8 +259,8 @@ def _on_disconnected(self, _client, _signal_name): ...@@ -260,8 +259,8 @@ def _on_disconnected(self, _client, _signal_name):
self.get_module('Chatstate').enabled = False self.get_module('Chatstate').enabled = False
self._reconnect = False self._reconnect = False
self._after_disconnect() self._after_disconnect()
app.nec.push_incoming_event(OurShowEvent( app.nec.push_incoming_event(NetworkEvent(
None, conn=self, show='offline')) 'our-show', conn=self, show='offline'))
self.process_ssl_errors() self.process_ssl_errors()
elif domain in (StreamError.STREAM, StreamError.BIND): elif domain in (StreamError.STREAM, StreamError.BIND):
...@@ -293,12 +292,12 @@ def _on_password(password): ...@@ -293,12 +292,12 @@ def _on_password(password):
self._after_disconnect() self._after_disconnect()
self._schedule_reconnect() self._schedule_reconnect()
app.nec.push_incoming_event( app.nec.push_incoming_event(
OurShowEvent(None, conn=self, show='error')) NetworkEvent('our-show', conn=self, show='error'))
else: else:
self.get_module('Chatstate').enabled = False self.get_module('Chatstate').enabled = False
app.nec.push_incoming_event(OurShowEvent( app.nec.push_incoming_event(NetworkEvent(
None, conn=self, show='offline')) 'our-show', conn=self, show='offline'))
self._after_disconnect() self._after_disconnect()
def _after_disconnect(self): def _after_disconnect(self):
...@@ -536,7 +535,7 @@ def _abort_reconnect(self): ...@@ -536,7 +535,7 @@ def _abort_reconnect(self):
self._set_state(ClientState.DISCONNECTED) self._set_state(ClientState.DISCONNECTED)
self._disable_reconnect_timer() self._disable_reconnect_timer()
app.nec.push_incoming_event( app.nec.push_incoming_event(
OurShowEvent(None, conn=self, show='offline')) NetworkEvent('our-show', conn=self, show='offline'))
if self._destroy_client: if self._destroy_client:
self._client.destroy() self._client.destroy()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment