[Tkabber-dev] r1219 - in trunk/tkabber: . plugins/iq

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Sep 3 14:47:15 MSD 2007


Author: sergei
Date: 2007-09-03 14:47:14 +0400 (Mon, 03 Sep 2007)
New Revision: 1219

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/iq/version.tcl
Log:
	* plugins/iq/version.tcl: Made reporting OS version optional as
	  required by XEP-0092.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-09-03 05:37:27 UTC (rev 1218)
+++ trunk/tkabber/ChangeLog	2007-09-03 10:47:14 UTC (rev 1219)
@@ -1,3 +1,8 @@
+2007-09-03  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/iq/version.tcl: Made reporting OS version optional as
+	  required by XEP-0092.
+
 2007-09-02  Sergei Golovan  <sgolovan at nes.ru>
 
 	* login.tcl: Added $connid suffix to authentication error dialog path

Modified: trunk/tkabber/plugins/iq/version.tcl
===================================================================
--- trunk/tkabber/plugins/iq/version.tcl	2007-09-03 05:37:27 UTC (rev 1218)
+++ trunk/tkabber/plugins/iq/version.tcl	2007-09-03 10:47:14 UTC (rev 1219)
@@ -4,6 +4,11 @@
     [::msgcat::mc "Reply to version (jabber:iq:version) requests."] \
         -group IQ -type boolean
 
+custom::defvar options(reply_iq_os_version) 1 \
+    [::msgcat::mc "Include operating system info into a reply to version\
+		  (jabber:iq:version) requests."] \
+        -group IQ -type boolean
+
 proc try_linux_version {distr file flag} {
     global linux_distribution
 
@@ -129,24 +134,27 @@
 
     jlib::wrapper:splitxml $child tag vars isempty chdata children
 
-    switch -glob -- $tcl_platform(os) {
-	Linux {
-	    set os "[guess_linux_distribution] $tcl_platform(osVersion)"
-	}
-	Win* {
-	    set os [guess_windows_version]
-	}
-	default {
-	    set os "$tcl_platform(os) $tcl_platform(osVersion)"
-	}
-    }
-    
     set restags [list \
 		     [jlib::wrapper:createtag name -chdata Tkabber] \
 		     [jlib::wrapper:createtag version -chdata \
-			  "$tkabber_version ($toolkit_version)"] \
-		     [jlib::wrapper:createtag os -chdata $os]]
+			  "$tkabber_version ($toolkit_version)"]]
 
+    if {$options(reply_iq_os_version)} {
+	switch -glob -- $tcl_platform(os) {
+	    Linux {
+		set os "[guess_linux_distribution] $tcl_platform(osVersion)"
+	    }
+	    Win* {
+		set os [guess_windows_version]
+	    }
+	    default {
+		set os "$tcl_platform(os) $tcl_platform(osVersion)"
+	    }
+	}
+    
+	lappend restags [jlib::wrapper:createtag os -chdata $os]
+    }
+
     set res [jlib::wrapper:createtag query \
 		 -vars {xmlns jabber:iq:version} \
 		 -subtags $restags]



More information about the Tkabber-dev mailing list