Commit 12b81860 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Remove unused code

Its impossible to get connected by accident without TLS. Connecting unencrypted is now a feature for developers. So showing a icon that reflects transport encryption seems not useful anymore.

We still show TLS information in the Server Info window
parent 037b0aba
......@@ -115,9 +115,6 @@ nicks = {} # type: Dict[str, str]
# from this transport
block_signed_in_notifications = {} # type: Dict[str, bool]
# type of each connection (ssl, tls, tcp, ...)
con_types = {} # type: Dict[str, Optional[str]]
proxy65_manager = None
cert_store = None
......@@ -466,21 +463,6 @@ def in_groupchat(account, room_jid):
return False
return gc_connected[account][room_jid]
def get_number_of_securely_connected_accounts():
"""
Return the number of the accounts that are SSL/TLS connected
"""
num_of_secured = 0
for account in connections:
if account_is_securely_connected(account):
num_of_secured += 1
return num_of_secured
def account_is_securely_connected(account):
if not account_is_connected(account):
return False
return con_types.get(account) in ('tls', 'ssl')
def get_transport_name_from_jid(jid, use_config_setting=True):
"""
Returns 'gg', 'irc' etc
......
......@@ -91,8 +91,7 @@ class StatusTable:
1)
self.current_row += 1
def add_status_row(self, show, str_status, show_lock=False,
indent=True, transport=None):
def add_status_row(self, show, str_status, indent=True, transport=None):
"""
Append a new row with status icon to the table
"""
......@@ -117,10 +116,6 @@ class StatusTable:
status_label.set_ellipsize(Pango.EllipsizeMode.END)
status_label.set_max_width_chars(30)
self.table.attach(status_label, 3, self.current_row, 1, 1)
if show_lock:
lock_image = Gtk.Image()
lock_image.set_from_icon_name('dialog-password', Gtk.IconSize.MENU)
self.table.attach(lock_image, 4, self.current_row, 1, 1)
self.current_row += 1
def fill_table_with_accounts(self, accounts):
......@@ -128,8 +123,6 @@ class StatusTable:
message = acct['message']
message = helpers.reduce_chars_newlines(message, 100, 1)
message = GLib.markup_escape_text(message)
con_type = app.con_types.get(acct['name'])
show_lock = con_type in ('tls', 'ssl')
account_label = GLib.markup_escape_text(acct['account_label'])
if message:
......@@ -137,10 +130,7 @@ class StatusTable:
else:
status = account_label
self.add_status_row(acct['show'],
status,
show_lock=show_lock,
indent=False)
self.add_status_row(acct['show'], status, indent=False)
for line in acct['event_lines']:
self.add_text_row(' ' + line, 1)
......
......@@ -290,13 +290,9 @@ class RosterWindow:
show = helpers.get_connection_status(account)
our_jid = app.get_jid_from_account(account)
tls_pixbuf = None
if app.account_is_securely_connected(account):
tls_pixbuf = 'changes-prevent'
it = self.model.append(None, [get_icon_name(show),
GLib.markup_escape_text(account), 'account', our_jid,
account, None, None, None, None, None, tls_pixbuf, True] +
account, None, None, None, None, None, None, True] +
[None] * self.nb_ext_renderers)
self._iters[account]['account'] = it
......@@ -1009,15 +1005,6 @@ class RosterWindow:
if not child_iter:
return
num_of_accounts = app.get_number_of_connected_accounts()
num_of_secured = app.get_number_of_securely_connected_accounts()
tls_pixbuf = None
if app.account_is_securely_connected(account) and not self.regroup or\
self.regroup and num_of_secured and num_of_secured == num_of_accounts:
tls_pixbuf = 'changes-prevent'
self.model[child_iter][Column.PADLOCK_PIXBUF] = tls_pixbuf
if self.regroup:
account_name = _('Merged accounts')
accounts = []
......@@ -2188,8 +2175,6 @@ class RosterWindow:
# No need to redraw contacts if we're quitting
if child_iterA:
self.model[child_iterA][Column.AVATAR_IMG] = None
if account in app.con_types:
app.con_types[account] = None
for jid in list(app.contacts.get_jid_list(account)):
lcontact = app.contacts.get_contacts(account, jid)
ctrl = app.interface.msg_win_mgr.get_gc_control(jid,
......
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