[Tkabber-dev] r2091 - in trunk/tkabber-plugins: . otr/msgs otr/tclotr

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Jan 25 21:11:08 MSK 2014


Author: sergei
Date: 2014-01-25 21:11:08 +0400 (Sat, 25 Jan 2014)
New Revision: 2091

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/otr/msgs/ru.msg
   trunk/tkabber-plugins/otr/tclotr/otr.tcl
Log:
	* otr/tclotr/otr.tcl: Fixed processing message state changes. Show
	  an info message when private conversation is started.

	* otr/msgs/ru.msg: Updated Russian translations.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2014-01-25 16:27:54 UTC (rev 2090)
+++ trunk/tkabber-plugins/ChangeLog	2014-01-25 17:11:08 UTC (rev 2091)
@@ -10,6 +10,11 @@
 	  data message if it was replied by an OTR error message (resend it
 	  after a new successful AKE).
 
+	* otr/tclotr/otr.tcl: Fixed processing message state changes. Show
+	  an info message when private conversation is started.
+
+	* otr/msgs/ru.msg: Updated Russian translations.
+
 2014-01-24  Sergei Golovan <sgolovan at nes.ru>
 
 	* otr/key.tcl, otr/otr.tcl: Finish all existing OTR sessions for a

Modified: trunk/tkabber-plugins/otr/msgs/ru.msg
===================================================================
--- trunk/tkabber-plugins/otr/msgs/ru.msg	2014-01-25 16:27:54 UTC (rev 2090)
+++ trunk/tkabber-plugins/otr/msgs/ru.msg	2014-01-25 17:11:08 UTC (rev 2091)
@@ -165,5 +165,21 @@
 ::msgcat::mcset ru "The fingerprint of your long term OTR DSA private key\
 	for this JID is the following:" "Отпечаток вашего долгоживущего закрытого\
 	ключа OTR следующий:"
-::msgcat::mcset ru "You don't have a private DSA key for this JID. Either import a 1024 bit DSA private key, or generate one."
+::msgcat::mcset ru "You don't have a private DSA key for this JID. Either\
+	import a 1024 bit DSA private key, or generate one." "У вас нет закрытого\
+	ключа DSA для этого JID. Или мпортируйте, или сгенерируйте себе\
+	1024-битный ключ."
 
+::msgcat::mcset ru "Encrypted message can't be deciphered" "Зашифрованное\
+	сообщение не удалось расшифровать"
+::msgcat::mcset ru "Message is not sent because encryption is required.\
+	Trying to start private conversation..." ""
+::msgcat::mcset ru "Message is not sent. Either end your private\
+	conversation, or restart it" "Сообщение не отправлено. Или\
+	завершите защищенный разговор, или начните заново"
+::msgcat::mcset ru "Unmatched protocol versions" "Несовпадающие версии\
+	протокола"
+::msgcat::mcset ru "Private conversation is refreshed" "Защищенный разговор\
+	начат заново"
+::msgcat::mcset ru "Private conversation is started" "Защищенный разговор\
+	начат"

Modified: trunk/tkabber-plugins/otr/tclotr/otr.tcl
===================================================================
--- trunk/tkabber-plugins/otr/tclotr/otr.tcl	2014-01-25 16:27:54 UTC (rev 2090)
+++ trunk/tkabber-plugins/otr/tclotr/otr.tcl	2014-01-25 17:11:08 UTC (rev 2091)
@@ -488,8 +488,9 @@
             if {[QueryPolicy $token REQUIRE_ENCRYPTION]} {
                 # TODO: Think about resending message after AKE
                 #Store $token $message
-                CallBack $token info "Message is not sent. Trying to start\
-                                      private conversation..."
+                CallBack $token info "Message is not sent because encryption\
+                                      is required. Trying to start private\
+                                      conversation..."
                 CallBack $token send [::otr::data::queryMessage $state(policy)]
                 return {}
             } elseif {[QueryPolicy $token SEND_WHITESPACE_TAG] &&
@@ -513,7 +514,7 @@
             # TODO: Think about resending message after AKE
             #Store $token $message
             CallBack $token info "Message is not sent. Either end your private\
-                                  conversation, or restart it."
+                                  conversation, or restart it"
             return {}
         }
     }
@@ -570,18 +571,9 @@
 
         Debug $token 2 "OTR query message"
 
-        NewSession $token $version
+        Delete $token
 
-        Delete $token
-        set keyid [expr {$state(keyid)-1}]
-        lassign [::otr::auth::createDHCommitMessage \
-                        $state(version) \
-                        $state(authstate) \
-                        $state(msgstate) \
-                        $state(r) \
-                        $state(x,$keyid) \
-                        -sinstance $state(sinstance)] \
-                        authstate msgstate message
+        lassign [NewSession $token $version] authstate msgstate message
         CallBack $token send $message
         set state(authstate) $authstate
         set state(msgstate) $msgstate
@@ -602,17 +594,7 @@
             if {[QueryPolicy $token WHITESPACE_START_AKE] && \
                     [set version [FindVersion $token $versions]]} {
 
-                NewSession $token $version
-
-                set keyid [expr {$state(keyid)-1}]
-                lassign [::otr::auth::createDHCommitMessage \
-                                $state(version) \
-                                $state(authstate) \
-                                $state(msgstate) \
-                                $state(r) \
-                                $state(x,$keyid) \
-                                -sinstance $state(sinstance)] \
-                                authstate msgstate reply
+                lassign [NewSession $token $version] authstate msgstate reply
                 CallBack $token send $reply
                 set state(authstate) $authstate
                 set state(msgstate) $msgstate
@@ -761,7 +743,7 @@
     }
 
     if {$version != $state(version)} {
-        set error "Unmatched protocol version"
+        set error "Unmatched protocol versions"
         Debug $token 1 $error
         CallBack $token info $error
         CallBack $token send [::otr::data::errorMessage $error]
@@ -911,6 +893,16 @@
         StoreSSID $token
 
         CallBack $token send $message
+
+        switch -- $state(msgstate) {
+            MSGSTATE_PLAINTEXT {
+                CallBack $token info "Private conversation is started"
+            }
+            default {
+                CallBack $token info "Private conversation is refreshed"
+            }
+        }
+
         set state(authstate) $authstate
         set state(msgstate) $msgstate
         Resend $token
@@ -944,6 +936,15 @@
         UpdatePeerDHKeysAfterAKE $token $state(gy) $keyidy
         StoreSSID $token
 
+        switch -- $state(msgstate) {
+            MSGSTATE_PLAINTEXT {
+                CallBack $token info "Private conversation is started"
+            }
+            default {
+                CallBack $token info "Private conversation is refreshed"
+            }
+        }
+
         set state(authstate) $authstate
         set state(msgstate) $msgstate
         Resend $token
@@ -1330,12 +1331,15 @@
     variable $token
     upvar 0 $token state
 
-    set state(authstate) AUTHSTATE_NONE
-    set state(msgstate) MSGSTATE_PLAINTEXT
-    set state(smpstate) SMPSTATE_EXPECT1
-
     set state(version) $version
     set state(r) [::otr::crypto::Int2Octets [::otr::crypto::random 128] 128]
+    set keyid [expr {$state(keyid)-1}]
+    ::otr::auth::createDHCommitMessage $state(version) \
+                                       $state(authstate) \
+                                       $state(msgstate) \
+                                       $state(r) \
+                                       $state(x,$keyid) \
+                                       -sinstance $state(sinstance)
 }
 
 # ::otr::Store --
@@ -1530,6 +1534,9 @@
         }
     }
     CallBack $token msgstate $state(msgstate)
+
+    set state(smpstate) SMPSTATE_EXPECT1
+    set state(smpprogress) SMP_NONE
 }
 
 # ::otr::TrackSMPState --



More information about the Tkabber-dev mailing list