Commit a75c42f6 authored by Philipp Hörist's avatar Philipp Hörist

Remove unused code

parent f8e137fa
......@@ -28,12 +28,9 @@ import logging
import operator
import nbxmpp
from nbxmpp.namespaces import Namespace
from gajim.common import app
from gajim.common.connection_handlers_events import StreamReceivedEvent
from gajim.common.connection_handlers_events import PresenceReceivedEvent
from gajim.common.connection_handlers_events import StreamConflictReceivedEvent
from gajim.common.connection_handlers_events import NotificationEvent
......@@ -181,17 +178,4 @@ class ConnectionHandlers(ConnectionHandlersBase):
ConnectionHandlersBase.__init__(self)
app.nec.register_incoming_event(PresenceReceivedEvent)
app.nec.register_incoming_event(StreamConflictReceivedEvent)
app.nec.register_incoming_event(NotificationEvent)
def _StreamCB(self, con, obj):
log.debug('StreamCB')
app.nec.push_incoming_event(StreamReceivedEvent(None,
conn=self, stanza=obj))
def _register_handlers(self, con, con_type):
# try to find another way to register handlers in each class
# that defines handlers
con.RegisterHandler('unknown', self._StreamCB,
Namespace.XMPP_STREAMS, xmlns=Namespace.STREAMS)
......@@ -19,7 +19,6 @@
import logging
import OpenSSL.crypto
from nbxmpp.namespaces import Namespace
from gajim.common import nec
......@@ -27,7 +26,6 @@ from gajim.common import helpers
from gajim.common import app
from gajim.common import i18n
from gajim.common.i18n import _
from gajim.common.const import SSLError
from gajim.common.jingle_transport import JingleTransportSocks5
from gajim.common.file_props import FilesProp
......@@ -35,18 +33,6 @@ from gajim.common.file_props import FilesProp
log = logging.getLogger('gajim.c.connection_handlers_events')
class StreamReceivedEvent(nec.NetworkIncomingEvent):
name = 'stream-received'
class StreamConflictReceivedEvent(nec.NetworkIncomingEvent):
name = 'stream-conflict-received'
base_network_events = ['stream-received']
def generate(self):
if self.base_event.stanza.getTag('conflict'):
self.conn = self.base_event.conn
return True
class PresenceReceivedEvent(nec.NetworkIncomingEvent):
name = 'presence-received'
......@@ -59,32 +45,6 @@ class OurShowEvent(nec.NetworkIncomingEvent):
class MessageSentEvent(nec.NetworkIncomingEvent):
name = 'message-sent'
class NewAccountConnectedEvent(nec.NetworkIncomingEvent):
name = 'new-account-connected'
def generate(self):
try:
self.errnum = self.conn.connection.Connection.ssl_errnum
except AttributeError:
self.errnum = 0 # we don't have an errnum
self.ssl_msg = ''
if self.errnum > 0:
self.ssl_msg = SSLError.get(self.errnum,
_('Unknown SSL error: %d') % self.errnum)
self.ssl_cert = ''
self.ssl_fingerprint_sha1 = ''
self.ssl_fingerprint_sha256 = ''
if self.conn.connection.Connection.ssl_certificate:
cert = self.conn.connection.Connection.ssl_certificate
self.ssl_cert = OpenSSL.crypto.dump_certificate(
OpenSSL.crypto.FILETYPE_PEM, cert).decode('utf-8')
self.ssl_fingerprint_sha1 = cert.digest('sha1').decode('utf-8')
self.ssl_fingerprint_sha256 = cert.digest('sha256').decode('utf-8')
return True
class NewAccountNotConnectedEvent(nec.NetworkIncomingEvent):
name = 'new-account-not-connected'
class ConnectionLostEvent(nec.NetworkIncomingEvent):
name = 'connection-lost'
......
......@@ -217,26 +217,6 @@ class Interface:
self.unblock_signed_in_notifications,
event.account)
@staticmethod
def handle_gc_error(gc_control, pritext, sectext):
if gc_control and gc_control.autorejoin is not None:
if gc_control.error_dialog:
gc_control.error_dialog.destroy()
def on_close(dummy):
gc_control.error_dialog.destroy()
gc_control.error_dialog = None
gc_control.error_dialog = ErrorDialog(pritext, sectext,
on_response_ok=on_close, on_response_cancel=on_close)
gc_control.error_dialog.set_modal(False)
if gc_control.parent_win:
gc_control.error_dialog.set_transient_for(
gc_control.parent_win.window)
else:
d = ErrorDialog(pritext, sectext)
if gc_control and gc_control.parent_win:
d.set_transient_for(gc_control.parent_win.window)
d.set_modal(False)
def handle_event_presence(self, obj):
# 'NOTIFY' (account, (jid, status, status message, resource,
# priority, timestamp))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment