# Path: wokkel/disco.py
# NS_DISCO = 'http://jabber.org/protocol/disco'
# NS_DISCO_INFO = NS_DISCO + '#info'
# NS_DISCO_ITEMS = NS_DISCO + '#items'
# IQ_GET = '/iq[@type="get"]'
# DISCO_INFO = IQ_GET + '/query[@xmlns="' + NS_DISCO_INFO + '"]'
# DISCO_ITEMS = IQ_GET + '/query[@xmlns="' + NS_DISCO_ITEMS + '"]'
# class DiscoFeature(unicode):
# class DiscoIdentity(object):
# class DiscoInfo(object):
# class DiscoItem(object):
# class DiscoItems(object):
# class _DiscoRequest(generic.Request):
# class DiscoClientProtocol(XMPPHandler):
# class DiscoHandler(XMPPHandler, IQHandlerMixin):
#     def toElement(self):
#     def fromElement(element):
#     def __init__(self, category, idType, name=None):
#     def toElement(self):
#     def fromElement(element):
#     def __init__(self):
#     def __iter__(self):
#     def append(self, item):
#     def toElement(self):
#     def fromElement(element):
#     def __init__(self, entity, nodeIdentifier='', name=None):
#     def toElement(self):
#     def fromElement(element):
#     def __init__(self):
#     def __iter__(self):
#     def append(self, item):
#     def toElement(self):
#     def fromElement(element):
#     def __init__(self, verb=None, nodeIdentifier='',
#                        recipient=None, sender=None):
#     def parseElement(self, element):
#     def toElement(self):
#     def requestInfo(self, entity, nodeIdentifier='', sender=None):
#     def requestItems(self, entity, nodeIdentifier='', sender=None):
#     def connectionInitialized(self):
#     def _onDiscoInfo(self, iq):
#         def toResponse(info):
#     def _onDiscoItems(self, iq):
#         def toResponse(items):
#     def _gatherResults(self, deferredList):
#         def cb(resultList):
#         def eb(failure):
#     def info(self, requestor, target, nodeIdentifier):
#     def items(self, requestor, target, nodeIdentifier):
# 
# Path: wokkel/iwokkel.py
# class IDisco(Interface):
# class IPubSubClient(Interface):
# class IPubSubService(Interface):
# class IPubSubResource(Interface):
# class IMUCClient(Interface):
# class IMUCStatuses(Interface):
#     def getDiscoInfo(requestor, target, nodeIdentifier=''):
#     def getDiscoItems(requestor, target, nodeIdentifier=''):
#     def itemsReceived(event):
#     def deleteReceived(event):
#     def purgeReceived(event):
#     def createNode(service, nodeIdentifier=None):
#     def deleteNode(service, nodeIdentifier):
#     def subscribe(service, nodeIdentifier, subscriber):
#     def unsubscribe(service, nodeIdentifier, subscriber):
#     def publish(service, nodeIdentifier, items=[]):
#     def notifyPublish(service, nodeIdentifier, notifications):
#     def notifyDelete(service, nodeIdentifier, subscribers,
#                      redirectURI=None):
#     def publish(requestor, service, nodeIdentifier, items):
#     def subscribe(requestor, service, nodeIdentifier, subscriber):
#     def unsubscribe(requestor, service, nodeIdentifier, subscriber):
#     def subscriptions(requestor, service):
#     def affiliations(requestor, service):
#     def create(requestor, service, nodeIdentifier):
#     def getConfigurationOptions():
#     def getDefaultConfiguration(requestor, service, nodeType):
#     def getConfiguration(requestor, service, nodeIdentifier):
#     def setConfiguration(requestor, service, nodeIdentifier, options):
#     def items(requestor, service, nodeIdentifier, maxItems, itemIdentifiers):
#     def retract(requestor, service, nodeIdentifier, itemIdentifiers):
#     def purge(requestor, service, nodeIdentifier):
#     def delete(requestor, service, nodeIdentifier):
#     def locateResource(request):
#     def getInfo(requestor, service, nodeIdentifier):
#     def getNodes(requestor, service, nodeIdentifier):
#     def getConfigurationOptions():
#     def publish(request):
#     def subscribe(request):
#     def unsubscribe(request):
#     def subscriptions(request):
#     def affiliations(request):
#     def create(request):
#     def default(request):
#     def configureGet(request):
#     def configureSet(request):
#     def items(request):
#     def retract(request):
#     def purge(request):
#     def delete(request):
#     def affiliationsGet(request):
#     def affiliationsSet(request):
#     def receivedSubject(room, user, subject):
#     def receivedHistory(room, user, message):
#     def configure(roomJID, options):
#     def getConfiguration(roomJID):
#     def join(roomJID, nick, historyOptions=None, password=None):
#     def nick(roomJID, nick):
#     def leave(roomJID):
#     def userJoinedRoom(room, user):
#     def groupChat(roomJID, body):
#     def chat(occupantJID, body):
#     def register(roomJID, options):
#     def subject(roomJID, subject):
#     def voice(roomJID):
#     def history(roomJID, messages):
#     def ban(roomJID, entity, reason=None, sender=None):
#     def kick(roomJID, nick, reason=None, sender=None):
#     def __contains__(key):
#     def __iter__():
#     def __len__():


from zope.interface import implementer
from twisted.words.protocols.jabber.error import StanzaError
from twisted.words.protocols.jabber.xmlstream import IQ, toResponse
from twisted.words.protocols.jabber.xmlstream import XMPPHandler
from wokkel import disco, iwokkel
    """

    def connectionInitialized(self):
        """
        Called when the XML stream has been initialized.

        This sets up an observer for incoming ping requests.
        """
        self.xmlstream.addObserver(PING_REQUEST, self.onPing)


    def onPing(self, iq):
        """
        Called when a ping request has been received.

        This immediately replies with a result response.
        """
        response = toResponse(iq, 'result')
        self.xmlstream.send(response)
        iq.handled = True


    def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
        """
        Get identity and features from this entity, node.

        This handler supports XMPP Ping, but only without a nodeIdentifier
        specified.
        """
        if not nodeIdentifier:

# Path: wokkel/disco.py
# NS_DISCO = 'http://jabber.org/protocol/disco'
# NS_DISCO_INFO = NS_DISCO + '#info'
# NS_DISCO_ITEMS = NS_DISCO + '#items'
# IQ_GET = '/iq[@type="get"]'
# DISCO_INFO = IQ_GET + '/query[@xmlns="' + NS_DISCO_INFO + '"]'
# DISCO_ITEMS = IQ_GET + '/query[@xmlns="' + NS_DISCO_ITEMS + '"]'
# class DiscoFeature(unicode):
# class DiscoIdentity(object):
# class DiscoInfo(object):
# class DiscoItem(object):
# class DiscoItems(object):
# class _DiscoRequest(generic.Request):
# class DiscoClientProtocol(XMPPHandler):
# class DiscoHandler(XMPPHandler, IQHandlerMixin):
#     def toElement(self):
#     def fromElement(element):
#     def __init__(self, category, idType, name=None):
#     def toElement(self):
#     def fromElement(element):
#     def __init__(self):
#     def __iter__(self):
#     def append(self, item):
#     def toElement(self):
#     def fromElement(element):
#     def __init__(self, entity, nodeIdentifier='', name=None):
#     def toElement(self):
#     def fromElement(element):
#     def __init__(self):
#     def __iter__(self):
#     def append(self, item):
#     def toElement(self):
#     def fromElement(element):
#     def __init__(self, verb=None, nodeIdentifier='',
#                        recipient=None, sender=None):
#     def parseElement(self, element):
#     def toElement(self):
#     def requestInfo(self, entity, nodeIdentifier='', sender=None):
#     def requestItems(self, entity, nodeIdentifier='', sender=None):
#     def connectionInitialized(self):
#     def _onDiscoInfo(self, iq):
#         def toResponse(info):
#     def _onDiscoItems(self, iq):
#         def toResponse(items):
#     def _gatherResults(self, deferredList):
#         def cb(resultList):
#         def eb(failure):
#     def info(self, requestor, target, nodeIdentifier):
#     def items(self, requestor, target, nodeIdentifier):
# 
# Path: wokkel/iwokkel.py
# class IDisco(Interface):
# class IPubSubClient(Interface):
# class IPubSubService(Interface):
# class IPubSubResource(Interface):
# class IMUCClient(Interface):
# class IMUCStatuses(Interface):
#     def getDiscoInfo(requestor, target, nodeIdentifier=''):
#     def getDiscoItems(requestor, target, nodeIdentifier=''):
#     def itemsReceived(event):
#     def deleteReceived(event):
#     def purgeReceived(event):
#     def createNode(service, nodeIdentifier=None):
#     def deleteNode(service, nodeIdentifier):
#     def subscribe(service, nodeIdentifier, subscriber):
#     def unsubscribe(service, nodeIdentifier, subscriber):
#     def publish(service, nodeIdentifier, items=[]):
#     def notifyPublish(service, nodeIdentifier, notifications):
#     def notifyDelete(service, nodeIdentifier, subscribers,
#                      redirectURI=None):
#     def publish(requestor, service, nodeIdentifier, items):
#     def subscribe(requestor, service, nodeIdentifier, subscriber):
#     def unsubscribe(requestor, service, nodeIdentifier, subscriber):
#     def subscriptions(requestor, service):
#     def affiliations(requestor, service):
#     def create(requestor, service, nodeIdentifier):
#     def getConfigurationOptions():
#     def getDefaultConfiguration(requestor, service, nodeType):
#     def getConfiguration(requestor, service, nodeIdentifier):
#     def setConfiguration(requestor, service, nodeIdentifier, options):
#     def items(requestor, service, nodeIdentifier, maxItems, itemIdentifiers):
#     def retract(requestor, service, nodeIdentifier, itemIdentifiers):
#     def purge(requestor, service, nodeIdentifier):
#     def delete(requestor, service, nodeIdentifier):
#     def locateResource(request):
#     def getInfo(requestor, service, nodeIdentifier):
#     def getNodes(requestor, service, nodeIdentifier):
#     def getConfigurationOptions():
#     def publish(request):
#     def subscribe(request):
#     def unsubscribe(request):
#     def subscriptions(request):
#     def affiliations(request):
#     def create(request):
#     def default(request):
#     def configureGet(request):
#     def configureSet(request):
#     def items(request):
#     def retract(request):
#     def purge(request):
#     def delete(request):
#     def affiliationsGet(request):
#     def affiliationsSet(request):
#     def receivedSubject(room, user, subject):
#     def receivedHistory(room, user, message):
#     def configure(roomJID, options):
#     def getConfiguration(roomJID):
#     def join(roomJID, nick, historyOptions=None, password=None):
#     def nick(roomJID, nick):
#     def leave(roomJID):
#     def userJoinedRoom(room, user):
#     def groupChat(roomJID, body):
#     def chat(occupantJID, body):
#     def register(roomJID, options):
#     def subject(roomJID, subject):
#     def voice(roomJID):
#     def history(roomJID, messages):
#     def ban(roomJID, entity, reason=None, sender=None):
#     def kick(roomJID, nick, reason=None, sender=None):
#     def __contains__(key):
#     def __iter__():
#     def __len__():


# Path: wokkel/ping.py
from zope.interface import implementer
from twisted.words.protocols.jabber.error import StanzaError
from twisted.words.protocols.jabber.xmlstream import IQ, toResponse
from twisted.words.protocols.jabber.xmlstream import XMPPHandler
from wokkel import disco, iwokkel

    """

    def connectionInitialized(self):
        """
        Called when the XML stream has been initialized.

        This sets up an observer for incoming ping requests.
        """
        self.xmlstream.addObserver(PING_REQUEST, self.onPing)


    def onPing(self, iq):
        """
        Called when a ping request has been received.

        This immediately replies with a result response.
        """
        response = toResponse(iq, 'result')
        self.xmlstream.send(response)
        iq.handled = True


    def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
        """
        Get identity and features from this entity, node.

        This handler supports XMPP Ping, but only without a nodeIdentifier
        specified.
        """
        if not nodeIdentifier:

            return [disco.DiscoFeature(NS_PING)]