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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Jan 30 14:07:51 MSK 2014


Author: sergei
Date: 2014-01-30 14:07:50 +0400 (Thu, 30 Jan 2014)
New Revision: 2121

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/otr/otr.tcl
Log:
	* otr/otr.tcl: Disable OTR contact menu if the contact is myself.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2014-01-30 05:15:00 UTC (rev 2120)
+++ trunk/tkabber-plugins/ChangeLog	2014-01-30 10:07:50 UTC (rev 2121)
@@ -4,6 +4,8 @@
 
 	* otr/msgs/ru.msg: Updated Russian translation.
 
+	* otr/otr.tcl: Disable OTR contact menu if the contact is myself.
+
 2014-01-29  Sergei Golovan <sgolovan at nes.ru>
 
 	* Makefile: Added otr subdirectory to the install list.

Modified: trunk/tkabber-plugins/otr/otr.tcl
===================================================================
--- trunk/tkabber-plugins/otr/otr.tcl	2014-01-30 05:15:00 UTC (rev 2120)
+++ trunk/tkabber-plugins/otr/otr.tcl	2014-01-30 10:07:50 UTC (rev 2121)
@@ -1366,11 +1366,6 @@
     variable options
     variable ctx
 
-    if {[lsearch -exact [connections] $xlib] >= 0} {
-	set state normal
-    } else {
-	set state disabled
-    }
     set njid [::xmpp::jid::normalize $jid]
 
     foreach key {allow-encryption require-encryption send-whitespace-tag
@@ -1380,7 +1375,7 @@
 	}
     }
 
-    if {![once_only $xlib $jid]} {
+    if {[::xmpp::jid::equal [my_jid $xlib $jid] $jid] || ![once_only $xlib $jid]} {
 	set state disabled
 	set qstate disabled
 	set rstate disabled
@@ -1409,6 +1404,12 @@
 	}
     }
 
+    if {[lsearch -exact [connections] $xlib] >= 0} {
+	set state normal
+    } else {
+	set state disabled
+    }
+
     set mm $m.otr_menu
     menu $mm -tearoff 0
     $mm add command -label [::msgcat::mc "Start OTR session"] \



More information about the Tkabber-dev mailing list