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

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Jan 22 15:08:22 MSK 2007


Author: sergei
Date: 2007-01-22 15:08:18 +0300 (Mon, 22 Jan 2007)
New Revision: 881

Added:
   trunk/tkabber/plugins/iq/ping.tcl
Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/iq.tcl
Log:
	* plugins/iq/ping.tcl: Added reply to XMPP ping (XEP-0199) support.

	* iq.tcl: Explicitly allowed ignoring <iq/> requests.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-01-19 22:03:20 UTC (rev 880)
+++ trunk/tkabber/ChangeLog	2007-01-22 12:08:18 UTC (rev 881)
@@ -1,3 +1,9 @@
+2007-01-22  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/iq/ping.tcl: Added reply to XMPP ping (XEP-0199) support.
+
+	* iq.tcl: Explicitly allowed ignoring <iq/> requests.
+
 2007-01-19  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/roster/conferences.tcl: Do not autojoin already joined

Modified: trunk/tkabber/iq.tcl
===================================================================
--- trunk/tkabber/iq.tcl	2007-01-19 22:03:20 UTC (rev 880)
+++ trunk/tkabber/iq.tcl	2007-01-22 12:08:18 UTC (rev 881)
@@ -69,6 +69,9 @@
 			-connection $connid \
 			-id $id
 		}
+		ignore {
+		    # Do nothing, swallow the request
+		}
 	    }
 	}
     } else {

Added: trunk/tkabber/plugins/iq/ping.tcl
===================================================================
--- trunk/tkabber/plugins/iq/ping.tcl	                        (rev 0)
+++ trunk/tkabber/plugins/iq/ping.tcl	2007-01-22 12:08:18 UTC (rev 881)
@@ -0,0 +1,28 @@
+# $Id$
+# Reply to XMPP Ping (XEP-0199) support
+
+#############################################################################
+
+namespace eval ping {
+    custom::defvar options(pong) 1 \
+	[::msgcat::mc "Reply to ping (urn:xmpp:ping) requests."] \
+	-group IQ \
+	-type boolean
+
+    iq::register_handler get query urn:xmpp:ping [namespace current]::reply
+}
+
+#############################################################################
+
+proc ping::reply {connid from lang child} {
+    variable options
+
+    if {$options(pong)} {
+	return [list result ""]
+    } else {
+	return [list ignore]
+    }
+}
+
+#############################################################################
+


Property changes on: trunk/tkabber/plugins/iq/ping.tcl
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native



More information about the Tkabber-dev mailing list