comparison src/browser/sat_browser/plugin_sec_otr.py @ 531:793f12d1f970

browser_side (plugin OTR): change some feedback messages
author souliane <souliane@mailoo.org>
date Fri, 05 Sep 2014 12:08:55 +0200
parents 1735aaeac652
children 19fc2ebc02dd
comparison
equal deleted inserted replaced
530:1735aaeac652 531:793f12d1f970
107 107
108 if status == otr.context.STATUS_AKE_INIT: 108 if status == otr.context.STATUS_AKE_INIT:
109 return 109 return
110 110
111 elif status == otr.context.STATUS_SEND_QUERY: 111 elif status == otr.context.STATUS_SEND_QUERY:
112 if msg_state in (otr.context.STATE_PLAINTEXT, otr.context.STATE_FINISHED): 112 if msg_state == otr.context.STATE_ENCRYPTED:
113 feedback = _('Attempting to refresh the private conversation with %s...')
114 else:
113 feedback = _('Attempting to start a private conversation with %s...') 115 feedback = _('Attempting to start a private conversation with %s...')
114 elif msg_state == otr.context.STATE_ENCRYPTED:
115 feedback = _('Attempting to refresh the private conversation with %s...')
116 116
117 elif status == otr.context.STATUS_AKE_SUCCESS: 117 elif status == otr.context.STATUS_AKE_SUCCESS:
118 trusted_str = _(u"Verified") if self.getCurrentTrust() else _(u"Unverified") 118 trusted_str = _(u"Verified") if self.getCurrentTrust() else _(u"Unverified")
119 if msg_state == otr.context.STATE_ENCRYPTED: 119 if msg_state == otr.context.STATE_ENCRYPTED:
120 feedback = trusted_str + (u" conversation with %s started. Your client is not logging this conversation.") 120 feedback = trusted_str + (u" conversation with %s started. Your client is not logging this conversation.")
123 123
124 elif status == otr.context.STATUS_END_OTR: 124 elif status == otr.context.STATUS_END_OTR:
125 if msg_state == otr.context.STATE_PLAINTEXT: 125 if msg_state == otr.context.STATE_PLAINTEXT:
126 feedback = FEEDBACK_NOT_PRIVATE 126 feedback = FEEDBACK_NOT_PRIVATE
127 elif msg_state == otr.context.STATE_ENCRYPTED: 127 elif msg_state == otr.context.STATE_ENCRYPTED:
128 log.error(_("OTR session ended but the context's state is still 'encrypted'!"))
129 elif msg_state == otr.context.STATE_FINISHED:
128 feedback = _("%s has ended his/her private conversation with you; you should do the same.") 130 feedback = _("%s has ended his/her private conversation with you; you should do the same.")
129 elif msg_state == otr.context.STATE_FINISHED:
130 feedback = _("Private conversation with %s lost.")
131 131
132 self.host.newMessageCb(self.peer, feedback % other_jid_s, "headline", self.host.whoami, {}) 132 self.host.newMessageCb(self.peer, feedback % other_jid_s, "headline", self.host.whoami, {})
133 133
134 def setCurrentTrust(self, new_trust='', act='asked', type_='trust'): 134 def setCurrentTrust(self, new_trust='', act='asked', type_='trust'):
135 log.debug("setCurrentTrust: trust={trust}, act={act}, type={type}".format(type=type_, trust=new_trust, act=act)) 135 log.debug("setCurrentTrust: trust={trust}, act={act}, type={type}".format(type=type_, trust=new_trust, act=act))