[Tkabber-dev] r1095 - in trunk/tkabber: . jabberlib-tclxml

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Apr 11 09:44:32 MSD 2007


Author: sergei
Date: 2007-04-11 09:44:29 +0400 (Wed, 11 Apr 2007)
New Revision: 1095

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/jabberlib-tclxml/jabberlib.tcl
Log:
	* jabberlib-tclxml/jabberlib.tcl: Added partial support of XEP-0203
	  (delayed delivery).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-04-10 08:19:45 UTC (rev 1094)
+++ trunk/tkabber/ChangeLog	2007-04-11 05:44:29 UTC (rev 1095)
@@ -1,3 +1,8 @@
+2007-04-11  Sergei Golovan  <sgolovan at nes.ru>
+
+	* jabberlib-tclxml/jabberlib.tcl: Added partial support of XEP-0203
+	  (delayed delivery).
+
 2007-04-10  Sergei Golovan  <sgolovan at nes.ru>
 
 	* messages.tcl, presence.tcl: Moved showing unsubscribed message

Modified: trunk/tkabber/jabberlib-tclxml/jabberlib.tcl
===================================================================
--- trunk/tkabber/jabberlib-tclxml/jabberlib.tcl	2007-04-10 08:19:45 UTC (rev 1094)
+++ trunk/tkabber/jabberlib-tclxml/jabberlib.tcl	2007-04-11 05:44:29 UTC (rev 1095)
@@ -1784,15 +1784,27 @@
 proc jlib::x_delay {xml} {
     foreach xelem $xml {
 	jlib::wrapper:splitxml $xelem tag vars isempty chdata children
-	
-	if {[jlib::wrapper:getattr $vars xmlns] == "jabber:x:delay"} {
-	    # 20060717T05:29:12
-	    # 20061118T03:35:56.415699
-	    if {[regexp {\d+\d\d\d\dT\d+:\d+:\d+} \
-			[jlib::wrapper:getattr $vars stamp] \
-			stamp]} {
-		return [clock scan $stamp -gmt 1]
+
+	switch -- [jlib::wrapper:getattr $vars xmlns] {
+	    urn:xmpp:delay {
+		# 2006-07-17T05:29:12Z
+		# 2006-11-18T03:35:56.415699Z
+		if {[regsub {(\d+)-(\d\d)-(\d\d)T(\d+:\d+:\d+)[^Z]*Z?} \
+			    [jlib::wrapper:getattr $vars stamp] \
+			    {\1\2\3T\4} \
+			    stamp]} {
+		    catch {return [clock scan $stamp -gmt 1]}
+		}
 	    }
+	    jabber:x:delay {
+		# 20060717T05:29:12
+		# 20061118T03:35:56.415699
+		if {[regexp {\d+\d\d\d\dT\d+:\d+:\d+} \
+			    [jlib::wrapper:getattr $vars stamp] \
+			    stamp]} {
+		    catch {return [clock scan $stamp -gmt 1]}
+		}
+	    }
 	}
     }
     return [clock seconds]



More information about the Tkabber-dev mailing list