# Path: pyxmpp/all.py



import sys
import logging
import pyxmpp.jabberd.all
from pyxmpp.all import JID,Iq,Presence,Message,StreamError,FeatureNotImplementedProtocolError
        self.stream.send(iq)
        return True

    def message(self,stanza):
        """Message handler for the component.

        Just echoes the message back if its type is not 'error' or
        'headline'. Please note that all message types but 'error' will
        be passed to the handler for 'normal' message unless some dedicated
        handler process them.

        :returns: `True` to indicate, that the stanza should not be processed
        any further."""
        if stanza.get_type()=="headline":
            return True
        subject=stanza.get_subject()
        if subject:
            subject=u"Re: "+subject
        m=Message(
            to_jid=stanza.get_from(),
            from_jid=stanza.get_to(),
            stanza_type=stanza.get_type(),
            subject=subject,
            body=stanza.get_body())
        self.stream.send(m)
        return True

    def presence(self,stanza):
        """Handle 'available' (without 'type') and 'unavailable' <presence/>
        stanzas -- echo them back."""

# Path: pyxmpp/all.py



# Path: examples/echocomponent.py
import sys
import logging
import pyxmpp.jabberd.all
from pyxmpp.all import JID,Iq,Presence,Message,StreamError,FeatureNotImplementedProtocolError

        self.stream.send(iq)
        return True

    def message(self,stanza):
        """Message handler for the component.

        Just echoes the message back if its type is not 'error' or
        'headline'. Please note that all message types but 'error' will
        be passed to the handler for 'normal' message unless some dedicated
        handler process them.

        :returns: `True` to indicate, that the stanza should not be processed
        any further."""
        if stanza.get_type()=="headline":
            return True
        subject=stanza.get_subject()
        if subject:
            subject=u"Re: "+subject
        m=Message(
            to_jid=stanza.get_from(),
            from_jid=stanza.get_to(),
            stanza_type=stanza.get_type(),
            subject=subject,
            body=stanza.get_body())
        self.stream.send(m)
        return True

    def presence(self,stanza):
        """Handle 'available' (without 'type') and 'unavailable' <presence/>
        stanzas -- echo them back."""

        p=Presence(