Changeset 35:2866eaae775f in ralphm-patches for xmpp_client_service.patch


Ignore:
Timestamp:
Feb 12, 2010, 12:01:52 PM (11 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Minor cleanups to deal with changed APIs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • xmpp_client_service.patch

    r34 r35  
    11diff -r 67a42d8a1c73 wokkel/client.py
    22--- a/wokkel/client.py  Fri Feb 12 09:31:19 2010 +0100
    3 +++ b/wokkel/client.py  Fri Feb 12 09:37:28 2010 +0100
    4 @@ -18,10 +18,11 @@
     3+++ b/wokkel/client.py  Fri Feb 12 11:46:41 2010 +0100
     4@@ -17,11 +17,12 @@
     5 from twisted.names.srvconnect import SRVConnector
    56 from twisted.python import log
    67 from twisted.words.protocols.jabber import client, error, sasl, xmlstream
    7  from twisted.words.protocols.jabber.jid import internJID as JID
     8-from twisted.words.protocols.jabber.jid import internJID as JID
    89-from twisted.words.xish import domish
     10+from twisted.words.protocols.jabber.jid import JID, internJID
    911+from twisted.words.xish import domish, utility
    1012 
     
    1214-from wokkel.subprotocols import StreamManager
    1315+from wokkel.compat import XmlStreamServerFactory
    14 +from wokkel.subprotocols import StreamManager, XMPPHandlerContainer
     16+from wokkel.subprotocols import StreamManager, XMPPHandlerCollection
    1517 
    1618 NS_CLIENT = 'jabber:client'
    1719 
    18 @@ -350,3 +351,130 @@
     20@@ -350,3 +351,132 @@
    1921             reply['id'] = iq['id']
    2022         reply.addElement((client.NS_XMPP_SESSION, 'session'))
     
    4446+
    4547+
    46 +class ClientService(XMPPHandlerContainer, service.Service):
     48+class ClientService(XMPPHandlerCollection, service.Service):
    4749+    """
    4850+    Service for accepting XMPP client connections.
     
    5860+    makes it easier to create adapters.
    5961+
    60 +    As an L{xmlstream.XMPPHandlerContainer}, this service creates a fake XML
     62+    As an L{xmlstream.XMPPHandlerCollection}, this service creates a fake XML
    6163+    stream that is passed to the XMPP subprotocol handlers. The received
    6264+    stanzas from the incoming client connections are passed on to the handlers
     
    7274+        self.port = port
    7375+
    74 +        self.factory = XmlStreamServerFactory(XMPPClientListenAuthenticator,
    75 +                                              self.domain)
     76+        def authenticatorFactory():
     77+            return XMPPClientListenAuthenticator(self.domain)
     78+
     79+        self.factory = XmlStreamServerFactory(authenticatorFactory)
    7680+        self.factory.addBootstrap(xmlstream.STREAM_CONNECTED_EVENT,
    7781+                                  self.makeConnection)
     
    8185+        self.streams = {}
    8286+
    83 +        XMPPHandlerContainer.__init__(self)
     87+        XMPPHandlerCollection.__init__(self)
    8488+
    8589+
     
    141145+        """
    142146+
    143 +        destination = JID(element["to"]).full()
     147+        destination = internJID(element["to"]).full()
    144148+
    145149+        if destination not in self.streams:
Note: See TracChangeset for help on using the changeset viewer.