public
Description: A twitter <-> XMPP gateway with search and track and other good stuff.
Homepage: http://dustin.github.com/twitterspy/
Clone URL: git://github.com/dustin/twitterspy.git
Click here to lend your support to: twitterspy and make a donation at www.pledgie.com !
Use ping message from wokkel instead of handcrafting one.
dustin (author)
Mon Jan 05 19:52:06 -0800 2009
commit  54260001ed85e77fda3d6a8bda0e2d96e1e81111
tree    d6b8d556d89aa4fb9afd614839eb60c0f19e3c00
parent  ec248e77ac1556d09f5f17d1620de47ede9aea95
...
13
14
15
 
16
17
18
...
83
84
85
86
87
88
89
90
91
92
 
 
 
93
94
 
95
96
97
98
 
99
100
101
...
13
14
15
16
17
18
19
...
84
85
86
 
 
 
 
 
 
 
87
88
89
90
 
91
92
93
94
 
95
96
97
98
0
@@ -13,6 +13,7 @@ from twisted.protocols import memcache
0
 
0
 from wokkel.xmppim import MessageProtocol, PresenceClientProtocol
0
 from wokkel.xmppim import AvailablePresence
0
+from wokkel import ping
0
 
0
 import xmpp_commands
0
 import config
0
@@ -83,19 +84,15 @@ class TwitterspyMessageProtocol(MessageProtocol):
0
         return prefix + str(self._pubid)
0
 
0
     def ping(self, fromjid, tojid):
0
-        iq = IQ(self.xmlstream, 'get')
0
-        iq['from'] = config.SCREEN_NAME
0
-        iq['to'] = tojid
0
-        iq.addElement(("urn:xmpp:ping", 'ping'))
0
-        d = iq.send()
0
-        start_time = time.time()
0
-        log.msg("Sending ping %s" % iq.toXml())
0
+        p = ping.Ping(self.xmlstream, config.SCREEN_NAME, tojid)
0
+        d = p.send()
0
+        log.msg("Sending ping %s" % p.toXml())
0
         def _gotPing(x):
0
-            duration = time.time() - start_time
0
+            duration = time.time() - p.start_time
0
             log.msg("pong %s" % tojid)
0
             self.send_plain(fromjid, "Pong (%s) - %fs" % (tojid, duration))
0
         def _gotError(x):
0
-            duration = time.time() - start_time
0
+            duration = time.time() - p.start_time
0
             log.msg("Got an error pinging %s: %s" % (tojid, x))
0
             self.send_plain(fromjid, "Error pinging %s (%fs): %s" % (tojid, duration, x))
0
         d.addCallback(_gotPing)
...
1
 
...
 
1
0
@@ -1 +1 @@
0
-Subproject commit 2ce0add5793051f841b502f99caff1c251c0ad05
0
+Subproject commit 18796ca973db33d65bf3a6653c95d715e0c82a79

Comments