[Tkabber-dev] r907 - in trunk/tkabber: . plugins/general

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Feb 9 00:24:21 MSK 2007


Author: sergei
Date: 2007-02-09 00:24:19 +0300 (Fri, 09 Feb 2007)
New Revision: 907

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/general/headlines.tcl
Log:
	* plugins/general/headlines.tcl: Don't ignore headline messages with
	  empty URL or subject.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-02-08 19:42:24 UTC (rev 906)
+++ trunk/tkabber/ChangeLog	2007-02-08 21:24:19 UTC (rev 907)
@@ -11,6 +11,9 @@
 	  (workaround of a bug with very long file names in Windows). Added
 	  extra open file checks during log conversion.
 
+	* plugins/general/headlines.tcl: Don't ignore headline messages with
+	  empty URL or subject.
+
 2007-02-07  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/si/socks5.tcl: Fixed bug with lowering case of JID. Resource

Modified: trunk/tkabber/plugins/general/headlines.tcl
===================================================================
--- trunk/tkabber/plugins/general/headlines.tcl	2007-02-08 19:42:24 UTC (rev 906)
+++ trunk/tkabber/plugins/general/headlines.tcl	2007-02-08 21:24:19 UTC (rev 907)
@@ -247,9 +247,7 @@
 	    }
 	}
     }
-    if {[cequal $url ""]} {
-        return
-    }
+
     if {[cequal $subject ""]} {
 	set subject $desc
     } else {
@@ -257,10 +255,19 @@
 	    set desc $subject
 	}
     }
-    if {[cequal $subject ""]} {
-	return
+
+    if {$subject == ""} {
+	set dsubject [::msgcat::mc "<none>"]
+    } else {
+	set dsubject $subject
     }
 
+    if {$desc == ""} {
+	set ddesc [::msgcat::mc "<none>"]
+    } else {
+	set ddesc $desc
+    }
+
     set hw [get_win $connid $from]
 
     if {![winfo exists $hw]} {
@@ -270,7 +277,7 @@
     set tw [get_tree $connid $from]
 
     if {$options(multiple) > 1} {
-        set text $subject
+	set text $dsubject
     } else {
         set text $from
     }
@@ -285,10 +292,10 @@
     if {($options(multiple) > 1) || ([cequal $subject $desc])} {
         set snode $fnode
     } else {
-        set snode $fnode-subject-[str2node $subject]
+        set snode $fnode-subject-[str2node $dsubject]
 
         if {![$tw exists $snode]} {
-            $tw insert end $fnode $snode -text [string map [list "\n" " "] $subject] -open 1 \
+            $tw insert end $fnode $snode -text [string map [list "\n" " "] $dsubject] -open 1 \
                 -image browser/headline -font $font \
                 -fill $options(seencolor) \
                 -data [list type subject text $subject unseen 0]
@@ -305,7 +312,7 @@
     set nodetext \
 	[cconcat \
 	     [clock format $props(seconds) -format $options(timestamp_format)] \
-		    [string map [list "\n" " "] $desc]]
+		    [string map [list "\n" " "] $ddesc]]
     $tw insert end $snode $anode -text $nodetext -open 1 \
         -fill $options(seencolor) -font $font \
         -data [array get props]
@@ -431,7 +438,7 @@
     $m add command -label [::msgcat::mc "Delete"] \
 	-command "[namespace current]::action delete \
 		    \$[namespace current]::headwindow \$[namespace current]::headnode"
-    update_menu $m 0
+    hook::add finload_hook [list [namespace current]::update_menu $m 0]
 
     if {[winfo exists [set m .h2popmenu]]} {
 	destroy $m
@@ -497,7 +504,9 @@
 
     switch -glob -- $props(type)/$action {
         article/browse {
-            browseurl $props(url)
+	    if {$props(url) != ""} {
+		browseurl $props(url)
+	    }
 
             if {$props(unseen)} {
                 set props(unseen) 0
@@ -652,6 +661,9 @@
         set props(unseen) $unseen
 
         set text $props(text)
+	if {$text == ""} {
+	    set text [::msgcat::mc "<none>"]
+	}
         set myfill $options(seencolor)
         if {$unseen > 0} {
             append text " ($unseen)"
@@ -804,7 +816,7 @@
 					 [jlib::wrapper:createtag desc \
 					      -chdata $props(text)]]]]
     set len [llength $send_jids]
-    set send_jids [update_combo_list $send_jids $to 5]
+    set send_jids [update_combo_list $send_jids $to 10]
     update_menu $menu $len
 }
 



More information about the Tkabber-dev mailing list