Changeset 9861 for trunk/src/chat_control.py
- Timestamp:
- 06/29/08 06:39:29 (5 months ago)
- Files:
-
- 1 modified
-
trunk/src/chat_control.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/chat_control.py
r9811 r9861 1057 1057 gajim.config.get('hide_chat_banner')) 1058 1058 1059 self.authentication_button = self.xml.get_widget('authentication_button') 1060 id = self.authentication_button.connect('clicked', self._on_authentication_button_clicked) 1061 self.handlers[id] = self.authentication_button 1062 1059 1063 # Add lock image to show chat encryption 1060 1064 self.lock_image = self.xml.get_widget('lock_image') … … 1116 1120 self.handlers[id] = widget 1117 1121 1118 self.session = session 1122 if not session: 1123 session = gajim.connections[self.account].find_controlless_session(self.contact.jid) 1124 self.session = session 1125 1119 1126 if session: 1120 1127 session.control = self 1121 1122 # Enable ecryption if needed 1128 self.session = session 1129 1130 if session.enable_encryption: 1131 self.print_esession_details() 1132 1133 # Enable encryption if needed 1123 1134 e2e_is_active = hasattr(self, 'session') and self.session and self.session.enable_encryption 1124 1135 self.gpg_is_active = False … … 1135 1146 self.session.loggable = gajim.config.get('log_encrypted_sessions') 1136 1147 self._show_lock_image(self.gpg_is_active, 'GPG', self.gpg_is_active, self.session and \ 1137 self.session.is_loggable() )1148 self.session.is_loggable(), self.session and self.session.verified_identity) 1138 1149 1139 1150 self.status_tooltip = gtk.Tooltips() … … 1366 1377 1367 1378 self._show_lock_image(self.gpg_is_active, 'GPG', self.gpg_is_active, self.session and \ 1368 self.session.is_loggable() )1379 self.session.is_loggable(), self.session and self.session.verified_identity) 1369 1380 1370 1381 def _show_lock_image(self, visible, enc_type = '', enc_enabled = False, chat_logged = False, authenticated = False): … … 1374 1385 logged_string = chat_logged and 'will' or 'will NOT' 1375 1386 1376 if enc_type == 'OTR':1377 authenticated_string = authenticated \1378 and ' and authenticated' \1379 or ' and NOT authenticated'1380 else:1381 authenticated_string = ''1382 1383 tooltip = '%s Encryption %s active%s.\n' \1387 if authenticated: 1388 authenticated_string = ' and authenticated' 1389 self.lock_image.set_from_stock('gtk-dialog-authentication', 1) 1390 else: 1391 authenticated_string = ' and NOT authenticated' 1392 self.lock_image.set_from_stock('gtk-dialog-warning', 1) 1393 1394 tooltip = '%s encryption %s active%s.\n' \ 1384 1395 'Your chat session %s be logged.' % \ 1385 (enc_type, status_string, authenticated_string, 1396 (enc_type, status_string, authenticated_string, 1386 1397 logged_string) 1387 1398 1388 self.lock_tooltip.set_tip(self. lock_image, tooltip)1389 self.widget_set_visible(self. lock_image, not visible)1399 self.lock_tooltip.set_tip(self.authentication_button, tooltip) 1400 self.widget_set_visible(self.authentication_button, not visible) 1390 1401 self.lock_image.set_sensitive(enc_enabled) 1402 1403 def _on_authentication_button_clicked(self, widget): 1404 if self.session and self.session.enable_encryption: 1405 dialogs.ESessionInfoWindow(self.session) 1391 1406 1392 1407 def _process_command(self, message): … … 1589 1604 1590 1605 ChatControlBase.print_conversation_line(self, msg, 'status', '', None) 1606 1607 if not self.session.verified_identity: 1608 ChatControlBase.print_conversation_line(self, 'SAS not verified', 'status', '', None) 1591 1609 else: 1592 1610 msg = _('E2E encryption disabled') 1593 1611 ChatControlBase.print_conversation_line(self, msg, 'status', '', None) 1612 1594 1613 self._show_lock_image(e2e_is_active, 'E2E', e2e_is_active, self.session and \ 1595 self.session.is_loggable() )1614 self.session.is_loggable(), self.session and self.session.verified_identity) 1596 1615 1597 1616 def print_conversation(self, text, frm='', tim=None, encrypted=False,
