[Tkabber-dev] r1837 - trunk/tkabber

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Sep 2 13:31:01 MSD 2009


Author: sergei
Date: 2009-09-02 13:31:01 +0400 (Wed, 02 Sep 2009)
New Revision: 1837

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/gpgme.tcl
   trunk/tkabber/muc.tcl
   trunk/tkabber/presence.tcl
   trunk/tkabber/privacy.tcl
Log:
	* gpgme.tcl, presence.tcl, privacy.tcl, muc.tcl: Removed obligatory
	  non-empty text status from presence stanzas and allowed GPG to sign
	  empty status messages (thanks to Jan Zachorowski).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2009-09-02 09:16:30 UTC (rev 1836)
+++ trunk/tkabber/ChangeLog	2009-09-02 09:31:01 UTC (rev 1837)
@@ -6,6 +6,10 @@
 	  variable and changed its default value to true. (thanks to Jan
 	  Zachorowski)
 
+	* gpgme.tcl, presence.tcl, privacy.tcl, muc.tcl: Removed obligatory
+	  non-empty text status from presence stanzas and allowed GPG to sign
+	  empty status messages (thanks to Jan Zachorowski).
+
 2009-08-17  Sergei Golovan  <sgolovan at nes.ru>
 
 	* msgs/de.msg: Updated German translation (thanks to Roger Sondermann).

Modified: trunk/tkabber/gpgme.tcl
===================================================================
--- trunk/tkabber/gpgme.tcl	2009-09-02 09:16:30 UTC (rev 1836)
+++ trunk/tkabber/gpgme.tcl	2009-09-02 09:31:01 UTC (rev 1837)
@@ -465,7 +465,7 @@
     variable warnings
     variable gpg_error_id
 
-    if {(!$options(sign-traffic)) || ([string equal $data ""])} {
+    if {!$options(sign-traffic)} {
         return
     }
 
@@ -1172,8 +1172,7 @@
 proc ::ssj::make_signature {varname xlib status} {
     upvar 2 $varname var
 
-    if {![string equal $status ""] && \
-	    ![catch {signed:output $xlib $status} cdata] && \
+    if {![catch {signed:output $xlib $status} cdata] && \
 	    ![string equal $cdata ""]} {
 	lappend var [::xmpp::xml::create x -xmlns $::NS(signed) \
 					   -cdata $cdata]

Modified: trunk/tkabber/muc.tcl
===================================================================
--- trunk/tkabber/muc.tcl	2009-09-02 09:16:30 UTC (rev 1836)
+++ trunk/tkabber/muc.tcl	2009-09-02 09:31:01 UTC (rev 1837)
@@ -1471,11 +1471,7 @@
 	set status $userstatus
     }
 
-    if {$textstatus == ""} {
-	set tstatus $statusdesc($status)
-    } else {
-	set tstatus $textstatus
-    }
+    set tstatus $textstatus
 
     set id [::xmpp::packetID $xlib]
     set pids($xlib,$id) $chatid
@@ -1685,11 +1681,7 @@
 	set status $userstatus
     }
 
-    if {$textstatus == ""} {
-	set tstatus $statusdesc($status)
-    } else {
-	set tstatus $textstatus
-    }
+    set tstatus $textstatus
 
     send_presence $xlib $status \
 		  -to $group/$nick \

Modified: trunk/tkabber/presence.tcl
===================================================================
--- trunk/tkabber/presence.tcl	2009-09-02 09:16:30 UTC (rev 1836)
+++ trunk/tkabber/presence.tcl	2009-09-02 09:31:01 UTC (rev 1837)
@@ -378,16 +378,12 @@
     }
 
     set userstatusdesc $statusdesc($newstatus)
-    if {[cequal $newtextstatus ""]} {
-	set status $userstatusdesc
-    } else {
-	set status $newtextstatus
-    }
+    set status $newtextstatus
 
     foreach xlib [connections] {
 	send_presence $xlib $newstatus \
 		      -status $status \
-		      -priority $userpriority
+		      -priority $newpriority
     }
 
     foreach chatid [lfilter chat::is_groupchat [chat::opened]] {
@@ -427,11 +423,7 @@
     }
 
     set userstatusdesc $statusdesc($userstatus)
-    if {[cequal $textstatus ""]} {
-	set status $userstatusdesc
-    } else {
-	set status $textstatus
-    }
+    set status $textstatus
 
     set curuserstatus $userstatus
     set curtextstatus $textstatus
@@ -461,10 +453,6 @@
 	}
     }
 
-    if {$stat == ""} {
-	set stat $statusdesc($status)
-    }
-    
     switch -- $type {
 	group   {
 	    set to $jid/[get_our_groupchat_nick [chat::chatid $xlib $jid]]
@@ -615,23 +603,41 @@
 ###############################################################################
 
 proc service_login {xlib jid} {
-    global userstatus
+    global userstatus curtextstatus
 
+    set newargs {}
+
+    if {$curtextstatus != ""} {
+	lappend newargs -status $curtextstatus
+    }
+
     switch -- $userstatus {
 	available {
-	    ::xmpp::sendPresence $xlib -to $jid
+	    set command [list ::xmpp::sendPresence $xlib -to $jid]
 	}
 	invisible {
-	    ::xmpp::sendPresence $xlib -to $jid -type $userstatus
+	    set command [list ::xmpp::sendPresence $xlib -to $jid -type $userstatus]
 	}
 	default {
-	    ::xmpp::sendPresence $xlib -to $jid -show $userstatus
+	    set command [list ::xmpp::sendPresence $xlib -to $jid -show $userstatus]
 	}
     }
+
+    eval $command $newargs
 }
 
 proc service_logout {xlib jid} {
-    ::xmpp::sendPresence $xlib -to $jid -type unavailable
+    global curtextstatus
+
+    set newargs {}
+
+    if {$curtextstatus != ""} {
+	lappend newargs -status $curtextstatus
+    }
+
+    set command [list ::xmpp::sendPresence $xlib -to $jid -type unavailable]
+
+    eval $command $newargs
 }
 
 proc service_login_logout_menu_item {m xlib jid} {

Modified: trunk/tkabber/privacy.tcl
===================================================================
--- trunk/tkabber/privacy.tcl	2009-09-02 09:16:30 UTC (rev 1836)
+++ trunk/tkabber/privacy.tcl	2009-09-02 09:31:01 UTC (rev 1837)
@@ -986,11 +986,7 @@
 	set status $userstatus
     }
 
-    if {$textstatus == ""} {
-	set tstatus $statusdesc($status)
-    } else {
-	set tstatus $textstatus
-    }
+    set tstatus $textstatus
 
     foreach jid $postitems {
 	send_presence $xlib $status -to $jid -status $tstatus



More information about the Tkabber-dev mailing list