comparison src/plugins/plugin_sec_otr.py @ 1463:364dcdae2bff

plugin OTR: fixes a couple of typos
author souliane <souliane@mailoo.org>
date Wed, 03 Sep 2014 20:55:54 +0200
parents 3265a2639182
children 8d61160ee4b8
comparison
equal deleted inserted replaced
1462:c74015dc2785 1463:364dcdae2bff
34 import copy 34 import copy
35 35
36 NS_OTR = "otr_plugin" 36 NS_OTR = "otr_plugin"
37 PRIVATE_KEY = "PRIVATE KEY" 37 PRIVATE_KEY = "PRIVATE KEY"
38 MAIN_MENU = D_('OTR') 38 MAIN_MENU = D_('OTR')
39 AUTH_TXT = D_("To authenticate your correspondent, you need to give your below fingerprint *BY AN EXTERNAL CANAL* (i.e. not in this chat), and check that the one he give you is the same as below. If there is a mismatch, there can be a spy between you !") 39 AUTH_TXT = D_("To authenticate your correspondent, you need to give your below fingerprint *BY AN EXTERNAL CANAL* (i.e. not in this chat), and check that the one he gives you is the same as below. If there is a mismatch, there can be a spy between you!")
40 DROP_TXT = D_("You private key is used to encrypt messages for your correspondent, nobody except you must know it, if you are in doubt, you should drop it !\n\nAre you sure you want to drop your private key ?") 40 DROP_TXT = D_("You private key is used to encrypt messages for your correspondent, nobody except you must know it, if you are in doubt, you should drop it!\n\nAre you sure you want to drop your private key?")
41 41
42 DEFAULT_POLICY_FLAGS = { 42 DEFAULT_POLICY_FLAGS = {
43 'ALLOW_V1':False, 43 'ALLOW_V1':False,
44 'ALLOW_V2':True, 44 'ALLOW_V2':True,
45 'REQUIRE_ENCRYPTION':True, 45 'REQUIRE_ENCRYPTION':True,
328 328
329 if other_fingerprint is None: 329 if other_fingerprint is None:
330 # we have a private key, but not the fingerprint of our correspondent 330 # we have a private key, but not the fingerprint of our correspondent
331 dialog = xml_tools.XMLUI(C.XMLUI_DIALOG, 331 dialog = xml_tools.XMLUI(C.XMLUI_DIALOG,
332 dialog_opt = {C.XMLUI_DATA_TYPE: C.XMLUI_DIALOG_MESSAGE, 332 dialog_opt = {C.XMLUI_DATA_TYPE: C.XMLUI_DIALOG_MESSAGE,
333 C.XMLUI_DATA_MESS: _("Your fingerprint is\n{fingerprint}\n\nStart an OTR conversation to have your correspondent one.").format(fingerprint=priv_key), 333 C.XMLUI_DATA_MESS: _("Your fingerprint is:\n{fingerprint}\n\nStart an OTR conversation to have your correspondent one.").format(fingerprint=priv_key),
334 C.XMLUI_DATA_LVL: C.XMLUI_DATA_LVL_INFO 334 C.XMLUI_DATA_LVL: C.XMLUI_DATA_LVL_INFO
335 }, 335 },
336 title = _("Fingerprint"), 336 title = _("Fingerprint"),
337 ) 337 )
338 return {'xmlui': dialog.toXml()} 338 return {'xmlui': dialog.toXml()}
340 def setTrust(raw_data, profile): 340 def setTrust(raw_data, profile):
341 # This method is called when authentication form is submited 341 # This method is called when authentication form is submited
342 data = xml_tools.XMLUIResult2DataFormResult(raw_data) 342 data = xml_tools.XMLUIResult2DataFormResult(raw_data)
343 if data['match'] == 'yes': 343 if data['match'] == 'yes':
344 otrctx.setCurrentTrust('verified') 344 otrctx.setCurrentTrust('verified')
345 note_msg = _("Your correspondant {correspondent} is now TRUSTED") 345 note_msg = _("Your correspondent {correspondent} is now TRUSTED")
346 else: 346 else:
347 otrctx.setCurrentTrust('') 347 otrctx.setCurrentTrust('')
348 note_msg = _("Your correspondant {correspondent} is now UNTRUSTED") 348 note_msg = _("Your correspondent {correspondent} is now UNTRUSTED")
349 note = xml_tools.XMLUI(C.XMLUI_DIALOG, dialog_opt = { 349 note = xml_tools.XMLUI(C.XMLUI_DIALOG, dialog_opt = {
350 C.XMLUI_DATA_TYPE: C.XMLUI_DIALOG_NOTE, 350 C.XMLUI_DATA_TYPE: C.XMLUI_DIALOG_NOTE,
351 C.XMLUI_DATA_MESS: note_msg.format(correspondent=otrctx.peer)} 351 C.XMLUI_DATA_MESS: note_msg.format(correspondent=otrctx.peer)}
352 ) 352 )
353 return {'xmlui': note.toXml()} 353 return {'xmlui': note.toXml()}