Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Jajcus/pyxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Konieczny <jajcus@jajcus.net>2003-06-10 16:22:58 +0400
committerJacek Konieczny <jajcus@jajcus.net>2003-06-10 16:22:58 +0400
commit0616e2191fabf68489ac6de05fd6a1534301bc1e (patch)
treebaadee396e0cf57ab55e00bd307923dfdaa1e4d2 /examples
parentcdc1e9d70024774e1a57c80d3ad0694074ff22f2 (diff)
- session establishement
Diffstat (limited to 'examples')
-rw-r--r--examples/stest.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/stest.py b/examples/stest.py
index f1f5e86..b3b5a5c 100644
--- a/examples/stest.py
+++ b/examples/stest.py
@@ -15,6 +15,19 @@ accounts={
class Stream(ClientStream):
def post_auth(self):
+ ClientStream.post_auth(self)
+ if not self.version:
+ self.welcome()
+ return
+ self.set_iq_set_handler("session","urn:ietf:params:xml:ns:xmpp-session",
+ self.set_session)
+
+ def set_session(self):
+ iq=stanza.make_result_reply()
+ self.send(iq)
+ self.welcome()
+
+ def welcome(self):
self.disconnect_time=time.time()+60
m=Message(type="chat",to=self.peer,
body="You have authenticated with: %r" % (self.auth_method_used))