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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Jan 29 20:32:10 MSK 2014


Author: sergei
Date: 2014-01-29 20:32:10 +0400 (Wed, 29 Jan 2014)
New Revision: 2119

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/otr/auth.tcl
   trunk/tkabber-plugins/otr/otr.tcl
Log:
	* otr/otr.tcl, otr/auth.tcl: Moved resetting auth icons to the otr.tcl.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2014-01-29 15:43:11 UTC (rev 2118)
+++ trunk/tkabber-plugins/ChangeLog	2014-01-29 16:32:10 UTC (rev 2119)
@@ -2,6 +2,8 @@
 
 	* Makefile: Added otr subdirectory to the install list.
 
+	* otr/otr.tcl, otr/auth.tcl: Moved resetting auth icons to the otr.tcl.
+
 2014-01-28  Sergei Golovan <sgolovan at nes.ru>
 
 	* otr/key.tcl, otr/otr.tcl: Drop existing OTR cnversations only if the

Modified: trunk/tkabber-plugins/otr/auth.tcl
===================================================================
--- trunk/tkabber-plugins/otr/auth.tcl	2014-01-29 15:43:11 UTC (rev 2118)
+++ trunk/tkabber-plugins/otr/auth.tcl	2014-01-29 16:32:10 UTC (rev 2119)
@@ -376,16 +376,7 @@
     }
     dict set Auth $authjid $items
     store $Auth
-    foreach xlib [connections] {
-	if {![::xmpp::jid::equal \
-		    [::xmpp::jid::removeResource \
-			    [connection_jid $xlib]] $authjid]} continue
-	foreach idx [array names [namespace parent]::ctx msgstate,$xlib,*] {
-	    regexp {msgstate,[^,]*,(.*)} $idx -> fjid
-	    [namespace parent]::on_msgstate_change $xlib $fjid \
-				    [set [namespace parent]::ctx($idx)]
-	}
-    }
+    [namespace parent]::reset_auth $authjid
     fill_mclistbox $w $l
 }
 

Modified: trunk/tkabber-plugins/otr/otr.tcl
===================================================================
--- trunk/tkabber-plugins/otr/otr.tcl	2014-01-29 15:43:11 UTC (rev 2118)
+++ trunk/tkabber-plugins/otr/otr.tcl	2014-01-29 16:32:10 UTC (rev 2119)
@@ -269,6 +269,21 @@
     }
 }
 
+proc otr::reset_auth {myjid} {
+    variable ctx
+
+    foreach xlib [connections] {
+	if {![::xmpp::jid::equal $myjid \
+		[::xmpp::jid::removeResource [connection_jid $xlib]]]} continue
+
+	foreach idx [array names ctx msgstate,$xlib,*] {
+	    regexp {msgstate,[^,]*,(.*)} $idx -> fjid
+	    on_msgstate_change $xlib $fjid $ctx($idx)
+	}
+    }
+
+}
+
 #############################################################################
 
 proc otr::on_authstate_change {xlib jid authstate} {



More information about the Tkabber-dev mailing list