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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Jan 23 20:03:38 MSK 2014


Author: sergei
Date: 2014-01-23 20:03:38 +0400 (Thu, 23 Jan 2014)
New Revision: 2083

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/otr/auth.tcl
   trunk/tkabber-plugins/otr/otr.tcl
   trunk/tkabber-plugins/otr/tclotr/otr.tcl
Log:
	* otr/auth.tcl: Remove profile with empty fingerprints list from the
	  stored authentications.

	* otr/otr.tcl: Assign the message icon directly while rewriting its
	  body and not when drawing.

	* otr/tclotr/otr.tcl: Fixed typos in callback invocations.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2014-01-23 14:43:47 UTC (rev 2082)
+++ trunk/tkabber-plugins/ChangeLog	2014-01-23 16:03:38 UTC (rev 2083)
@@ -5,6 +5,14 @@
 	  callbacks. Fixed OTR labels for incoming chat messages. Disabled
 	  some OTR menu items depending on the current message state.
 
+	* otr/auth.tcl: Remove profile with empty fingerprints list from the
+	  stored authentications.
+
+	* otr/otr.tcl: Assign the message icon directly while rewriting its
+	  body and not when drawing.
+
+	* otr/tclotr/otr.tcl: Fixed typos in callback invocations.
+
 2014-01-22  Sergei Golovan <sgolovan at nes.ru>
 
 	* otr/auth.tcl, otr/otr.tcl, otr/tclotr/otr.tcl: Store the

Modified: trunk/tkabber-plugins/otr/auth.tcl
===================================================================
--- trunk/tkabber-plugins/otr/auth.tcl	2014-01-23 14:43:47 UTC (rev 2082)
+++ trunk/tkabber-plugins/otr/auth.tcl	2014-01-23 16:03:38 UTC (rev 2083)
@@ -35,7 +35,11 @@
 
     set subtags {}
     dict for {jid val} $auth {
-	lappend subtags [serialize_auth_items $jid $val]
+	set items [serialize_auth_items $jid $val]
+	::xmpp::xml::split $items tag xmlns attrs cdata subels
+	if {[llength $subels] > 0} {
+	    lappend subtags $items
+	}
     }
 
     ::xmpp::xml::toTabbedText [::xmpp::xml::create authentication \

Modified: trunk/tkabber-plugins/otr/otr.tcl
===================================================================
--- trunk/tkabber-plugins/otr/otr.tcl	2014-01-23 14:43:47 UTC (rev 2082)
+++ trunk/tkabber-plugins/otr/otr.tcl	2014-01-23 16:03:38 UTC (rev 2083)
@@ -134,18 +134,7 @@
 
 	if {$tag eq "" && $xmlns eq $ns} {
 	    set chatw [chat::chat_win $chatid]
-	    if {[::xmpp::xml::getAttr $attrs warn] == 1} {
-		$chatw image create end -image otr/notprivate
-	    } else {
-		once_only $xlib $from
-		switch -- $ctx(msgstate,$xlib,$from) {
-		    MSGSTATE_ENCRYPTED -
-		    MSGSTATE_FINISHED {
-			$chatw image create end \
-			       -image [msgstate:icon $xlib $from]
-		    }
-		}
-	    }
+	    $chatw image create end -image [::xmpp::xml::getAttr $attrs icon]
 	    break
 	}
     }
@@ -173,19 +162,8 @@
 	    if {[winfo exists $lb]} {
 		destroy $lb
 	    }
-	    if {[::xmpp::xml::getAttr $attrs warn] == 1} {
-		Label $lb -image otr/notprivate
-		grid $lb -row 1 -column 4 -sticky e
-	    } else {
-		once_only $xlib $from
-		switch -- $ctx(msgstate,$xlib,$from) {
-		    MSGSTATE_ENCRYPTED -
-		    MSGSTATE_FINISHED {
-			Label $lb -image [msgstate:icon $xlib $from]
-			grid $lb -row 1 -column 4 -sticky e
-		    }
-		}
-	    }
+	    Label $lb -image [::xmpp::xml::getAttr $attrs icon]
+	    grid $lb -row 1 -column 4 -sticky e
 	    break
 	}
     }
@@ -865,9 +843,13 @@
     if {[info exists res(message)]} {
 	set body $res(message)
 	if {[info exists res(warn)]} {
-	    lappend x [::xmpp::xml::create "" -xmlns $ns -attrs {warn 1}]
+	    lappend x [::xmpp::xml::create "" \
+				-xmlns $ns \
+				-attrs {icon otr/notprivate}]
 	} else {
-	    lappend x [::xmpp::xml::create "" -xmlns $ns]
+	    lappend x [::xmpp::xml::create "" \
+				-xmlns $ns \
+				-attrs [list icon [msgstate:icon $xlib $from]]]
 	}
     } else {
 	lappend x [::xmpp::xml::create "" -xmlns $ns -attrs {discard 1}]

Modified: trunk/tkabber-plugins/otr/tclotr/otr.tcl
===================================================================
--- trunk/tkabber-plugins/otr/tclotr/otr.tcl	2014-01-23 14:43:47 UTC (rev 2082)
+++ trunk/tkabber-plugins/otr/tclotr/otr.tcl	2014-01-23 16:03:38 UTC (rev 2083)
@@ -738,7 +738,7 @@
             3 {
                 Debug $token 1 "Var state(version) is not set"
                 set error "Encrypted message can't be deciphered"
-                CallBack $token info $error \
+                CallBack $token info $error
                 CallBack $token send [::otr::data::errorMessage $error]
                 return {}
             }
@@ -751,7 +751,7 @@
     if {$version != $state(version)} {
         set error "Unmatched protocol version"
         Debug $token 1 $error
-        CallBack $token info $error \
+        CallBack $token info $error
         CallBack $token send [::otr::data::errorMessage $error]
         return {}
     }



More information about the Tkabber-dev mailing list