# Path: pyxmpp/all.py

# 
# Path: pyxmpp/jabber/all.py



import libxml2
import time
import sys
import traceback
import socket
import logging
from pyxmpp.all import JID,Iq,Presence,Message,StreamError
from pyxmpp.jabber.all import LegacyClientStream
        iq.free()

    def welcome(self):
        m=Message(type="chat",to=self.peer,
                body="You have authenticated with: %r" % (self.auth_method_used))
        self.send(m)
        m=Message(type="chat",to=self.peer,body="You will be disconnected in 1 minute.")
        self.send(m)
        m=Message(type="chat",to=self.peer,body="Thank you for testing.")
        self.send(m)
        self.set_message_handler('chat',self.echo_message)
        self.set_message_handler('normal',self.echo_message)

    def echo_message(self,message):
        typ=message.get_type()
        body=message.get_body()
        if not body:
            return
        body=u"ECHO: %s" % (body,)
        subject=message.get_subject()
        if subject:
            subject=u"Re: %s" % (subject,)
        m=Message(type=typ,to=self.peer,body=body,subject=subject)
        self.send(m)

    def idle(self):
        ClientStream.idle(self)
        if not self.peer_authenticated:
            return
        if time.time()>=self.disconnect_time:

# Path: pyxmpp/all.py

# 
# Path: pyxmpp/jabber/all.py



# Path: examples/server_c2s.py
import libxml2
import time
import sys
import traceback
import socket
import logging
from pyxmpp.all import JID,Iq,Presence,Message,StreamError
from pyxmpp.jabber.all import LegacyClientStream

        iq.free()

    def welcome(self):
        m=Message(type="chat",to=self.peer,
                body="You have authenticated with: %r" % (self.auth_method_used))
        self.send(m)
        m=Message(type="chat",to=self.peer,body="You will be disconnected in 1 minute.")
        self.send(m)
        m=Message(type="chat",to=self.peer,body="Thank you for testing.")
        self.send(m)
        self.set_message_handler('chat',self.echo_message)
        self.set_message_handler('normal',self.echo_message)

    def echo_message(self,message):
        typ=message.get_type()
        body=message.get_body()
        if not body:
            return
        body=u"ECHO: %s" % (body,)
        subject=message.get_subject()
        if subject:
            subject=u"Re: %s" % (subject,)
        m=Message(type=typ,to=self.peer,body=body,subject=subject)
        self.send(m)

    def idle(self):
        ClientStream.idle(self)
        if not self.peer_authenticated:
            return
        if time.time()>=self.disconnect_time:

            m=Message(type="chat",to=self.peer,body="Bye.")