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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Jan 27 08:53:49 MSK 2014


Author: sergei
Date: 2014-01-27 08:53:49 +0400 (Mon, 27 Jan 2014)
New Revision: 2104

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/otr/otr.tcl
Log:
	* otr/otr.tcl: Fail to load OTR plugin if Tkabber doesn't support the
	  necessary features.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2014-01-26 17:03:59 UTC (rev 2103)
+++ trunk/tkabber-plugins/ChangeLog	2014-01-27 04:53:49 UTC (rev 2104)
@@ -1,3 +1,8 @@
+2014-01-27  Sergei Golovan <sgolovan at nes.ru>
+
+	* otr/otr.tcl: Fail to load OTR plugin if Tkabber doesn't support the
+	  necessary features.
+
 2014-01-26  Sergei Golovan <sgolovan at nes.ru>
 
 	* otr/tclotr/otr.tcl: Fixed refreshing private connection if the

Modified: trunk/tkabber-plugins/otr/otr.tcl
===================================================================
--- trunk/tkabber-plugins/otr/otr.tcl	2014-01-26 17:03:59 UTC (rev 2103)
+++ trunk/tkabber-plugins/otr/otr.tcl	2014-01-27 04:53:49 UTC (rev 2104)
@@ -17,6 +17,15 @@
     ::msgcat::mcload [file join $scriptdir msgs]
     ::trans::load [file join $scriptdir trans]
 
+    # Check if Tkabber is sufficiently new
+
+    if {[hook::is_empty send_normal_message_hook]} {
+	puts stderr [::msgcat::mc "Tkabber is too old for the OTR plugin"]
+	# Clean up what's already here and bail out:
+	namespace delete [namespace current]
+	return
+    }
+
     # Attempt to load TclOTR. Warn and quit loading plugin if we can't:
 
     if {[catch { package require otr } err]} {



More information about the Tkabber-dev mailing list