[Tkabber-dev] [tclxmpp commit] r66 - in trunk: . xmpp

codesite-noreply at google.com codesite-noreply at google.com
Sun Dec 14 19:46:47 MSK 2008


Author: sgolovan
Date: Sun Dec 14 08:46:26 2008
New Revision: 66

Modified:
    trunk/ChangeLog
    trunk/xmpp/xmpp.tcl

Log:
	* xmpp/xmpp.tcl: Don't allow arbitrary message type. Made debug
	  messages a bit more clear and added timestamp to them.


Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	(original)
+++ trunk/ChangeLog	Sun Dec 14 08:46:26 2008
@@ -1,3 +1,8 @@
+2008-12-14  Sergei Golovan  <sgolovan at nes.ru>
+
+	* xmpp/xmpp.tcl: Don't allow arbitrary message type. Made debug
+	  messages a bit more clear and added timestamp to them.
+
  2008-11-18  Sergei Golovan  <sgolovan at nes.ru>

  	* doc/*.man: Made ViM modelines prettier.

Modified: trunk/xmpp/xmpp.tcl
==============================================================================
--- trunk/xmpp/xmpp.tcl	(original)
+++ trunk/xmpp/xmpp.tcl	Sun Dec 14 08:46:26 2008
@@ -1257,7 +1257,21 @@
      foreach {key val} $attrs {
          switch -- $key {
              from     {set from $val}
-            type     {set type $val}
+            type     {
+                switch -- $val {
+                    chat -
+                    error -
+                    groupchat -
+                    headline -
+                    normal {
+                        set type $val
+                    }
+                    default {
+                        Debug $xlib 1 \
+                              [::msgcat::mc "Unknown message type %s" $val]
+                    }
+                }
+            }
              xml:lang {lappend params -lang $val}
              to       {lappend params -to   $val}
              id       {lappend params -id   $val}
@@ -1420,7 +1434,8 @@

                  uplevel #0 $cmd [list ok [lindex $subels 0]]
              } else {
-                Debug $xlib 1 [::msgcat::mc "IQ id doesn't exists in  
memory"]
+                Debug $xlib 1 \
+                      [::msgcat::mc "IQ id %s doesn't exist in memory" $id]
              }
              return
          }
@@ -1440,7 +1455,8 @@

                  uplevel #0 $cmd [list error $error]
              } else {
-                Debug $xlib 1 [::msgcat::mc "IQ id doesn't exists in  
memory"]
+                Debug $xlib 1 \
+                      [::msgcat::mc "IQ id %s doesn't exist in memory" $id]
              }
              return
          }
@@ -1736,7 +1752,10 @@
          unset state(iq,$id)

          uplevel #0 $cmd [list $status $error]
+    } else {
+        Debug $xlib 1 [::msgcat::mc "IQ id %s doesn't exist in memory" $id]
      }
+
      return
  }

@@ -1891,7 +1910,8 @@
      variable debug

      if {$debug >= $level} {
-        puts "[lindex [info level -1] 0] $xlib: $str"
+        puts "[clock format [clock seconds] -format %T]\
+              [lindex [info level -1] 0] $xlib $str"
      }

      return


More information about the Tkabber-dev mailing list