encrytion state is keeped even if we close the chat window
This commit is contained in:
parent
004094b10f
commit
210d989525
4 changed files with 15 additions and 5 deletions
|
@ -40,3 +40,5 @@ if LANG:
|
||||||
LANG = LANG[:2] # en, fr, el etc..
|
LANG = LANG[:2] # en, fr, el etc..
|
||||||
else:
|
else:
|
||||||
LANG = 'en'
|
LANG = 'en'
|
||||||
|
|
||||||
|
encrypted_chats = {} # list of encrypted chats {acct1: [jid1, jid2], ..}
|
||||||
|
|
|
@ -1163,6 +1163,7 @@ _('To change the account name, it must be disconnected.')).get_response()
|
||||||
self.plugin.roster.to_be_removed[self.account]
|
self.plugin.roster.to_be_removed[self.account]
|
||||||
self.plugin.sleeper_state[name] = \
|
self.plugin.sleeper_state[name] = \
|
||||||
self.plugin.sleeper_state[self.account]
|
self.plugin.sleeper_state[self.account]
|
||||||
|
gajim.encrypted_chats[name] = gajim.encrypted_chats[self.account]
|
||||||
#upgrade account variable in opened windows
|
#upgrade account variable in opened windows
|
||||||
for kind in ['infos', 'chats', 'gc', 'gc_config']:
|
for kind in ['infos', 'chats', 'gc', 'gc_config']:
|
||||||
for j in self.plugin.windows[name][kind]:
|
for j in self.plugin.windows[name][kind]:
|
||||||
|
@ -1178,6 +1179,7 @@ _('To change the account name, it must be disconnected.')).get_response()
|
||||||
del self.plugin.roster.groups[self.account]
|
del self.plugin.roster.groups[self.account]
|
||||||
del self.plugin.roster.contacts[self.account]
|
del self.plugin.roster.contacts[self.account]
|
||||||
del self.plugin.sleeper_state[self.account]
|
del self.plugin.sleeper_state[self.account]
|
||||||
|
del gajim.encrypted_chats[self.account]
|
||||||
gajim.connections[self.account].name = name
|
gajim.connections[self.account].name = name
|
||||||
gajim.connections[name] = gajim.connections[self.account]
|
gajim.connections[name] = gajim.connections[self.account]
|
||||||
del gajim.connections[self.account]
|
del gajim.connections[self.account]
|
||||||
|
@ -1227,6 +1229,7 @@ _('To change the account name, it must be disconnected.')).get_response()
|
||||||
self.plugin.nicks[name] = config['name']
|
self.plugin.nicks[name] = config['name']
|
||||||
self.plugin.allow_notifications[name] = False
|
self.plugin.allow_notifications[name] = False
|
||||||
self.plugin.sleeper_state[name] = 0
|
self.plugin.sleeper_state[name] = 0
|
||||||
|
gajim.encrypted_chats[name] = []
|
||||||
#refresh accounts window
|
#refresh accounts window
|
||||||
if self.plugin.windows.has_key('accounts'):
|
if self.plugin.windows.has_key('accounts'):
|
||||||
self.plugin.windows['accounts'].init_accounts()
|
self.plugin.windows['accounts'].init_accounts()
|
||||||
|
|
|
@ -508,6 +508,7 @@ class Interface:
|
||||||
self.roster.newly_added[name] = []
|
self.roster.newly_added[name] = []
|
||||||
self.roster.to_be_removed[name] = []
|
self.roster.to_be_removed[name] = []
|
||||||
self.sleeper_state[name] = 0
|
self.sleeper_state[name] = 0
|
||||||
|
gajim.encrypted_chats[name] = []
|
||||||
if self.windows.has_key('accounts'):
|
if self.windows.has_key('accounts'):
|
||||||
self.windows['accounts'].init_accounts()
|
self.windows['accounts'].init_accounts()
|
||||||
self.roster.draw_roster()
|
self.roster.draw_roster()
|
||||||
|
@ -844,6 +845,7 @@ class Interface:
|
||||||
#1:online and use sleeper
|
#1:online and use sleeper
|
||||||
#2:autoaway and use sleeper
|
#2:autoaway and use sleeper
|
||||||
#3:autoxa and use sleeper
|
#3:autoxa and use sleeper
|
||||||
|
gajim.encrypted_chats[a] = []
|
||||||
|
|
||||||
self.roster = roster_window.RosterWindow(self)
|
self.roster = roster_window.RosterWindow(self)
|
||||||
path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps/gajim.png')
|
path_to_file = os.path.join(gajim.DATA_DIR, 'pixmaps/gajim.png')
|
||||||
|
|
|
@ -44,7 +44,6 @@ class TabbedChatWindow(chat.Chat):
|
||||||
def __init__(self, user, plugin, account):
|
def __init__(self, user, plugin, account):
|
||||||
chat.Chat.__init__(self, plugin, account, 'tabbed_chat_window')
|
chat.Chat.__init__(self, plugin, account, 'tabbed_chat_window')
|
||||||
self.users = {}
|
self.users = {}
|
||||||
self.encrypted = {}
|
|
||||||
self.new_user(user)
|
self.new_user(user)
|
||||||
self.show_title()
|
self.show_title()
|
||||||
self.xml.signal_connect('on_tabbed_chat_window_destroy',
|
self.xml.signal_connect('on_tabbed_chat_window_destroy',
|
||||||
|
@ -238,7 +237,9 @@ class TabbedChatWindow(chat.Chat):
|
||||||
self.xmls[user.jid] = gtk.glade.XML(GTKGUI_GLADE, 'chats_vbox', APP)
|
self.xmls[user.jid] = gtk.glade.XML(GTKGUI_GLADE, 'chats_vbox', APP)
|
||||||
self.childs[user.jid] = self.xmls[user.jid].get_widget('chats_vbox')
|
self.childs[user.jid] = self.xmls[user.jid].get_widget('chats_vbox')
|
||||||
self.users[user.jid] = user
|
self.users[user.jid] = user
|
||||||
self.encrypted[user.jid] = False
|
|
||||||
|
if user.jid in gajim.encrypted_chats[self.account]:
|
||||||
|
self.xmls[user.jid].get_widget('gpg_togglebutton').set_active(True)
|
||||||
|
|
||||||
xm = gtk.glade.XML(GTKGUI_GLADE, 'tabbed_chat_popup_menu', APP)
|
xm = gtk.glade.XML(GTKGUI_GLADE, 'tabbed_chat_popup_menu', APP)
|
||||||
xm.signal_autoconnect(self)
|
xm.signal_autoconnect(self)
|
||||||
|
@ -378,13 +379,15 @@ class TabbedChatWindow(chat.Chat):
|
||||||
kind = 'status'
|
kind = 'status'
|
||||||
name = ''
|
name = ''
|
||||||
else:
|
else:
|
||||||
if encrypted and not self.encrypted[jid]:
|
ec = gajim.encrypted_chats[self.account]
|
||||||
|
if encrypted and jid not in ec:
|
||||||
chat.Chat.print_conversation_line(self, 'Encryption enabled', jid,
|
chat.Chat.print_conversation_line(self, 'Encryption enabled', jid,
|
||||||
'status', '', tim)
|
'status', '', tim)
|
||||||
if not encrypted and self.encrypted[jid]:
|
ec.append(jid)
|
||||||
|
if not encrypted and jid in ec:
|
||||||
chat.Chat.print_conversation_line(self, 'Encryption disabled', jid,
|
chat.Chat.print_conversation_line(self, 'Encryption disabled', jid,
|
||||||
'status', '', tim)
|
'status', '', tim)
|
||||||
self.encrypted[jid] = encrypted
|
ec.remove(jid)
|
||||||
self.xmls[jid].get_widget('gpg_togglebutton').set_active(encrypted)
|
self.xmls[jid].get_widget('gpg_togglebutton').set_active(encrypted)
|
||||||
if contact:
|
if contact:
|
||||||
kind = 'outgoing'
|
kind = 'outgoing'
|
||||||
|
|
Loading…
Add table
Reference in a new issue