Changeset 35:2866eaae775f in ralphm-patches for xmpp_client_service.patch
- Timestamp:
- Feb 12, 2010, 12:01:52 PM (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
xmpp_client_service.patch
r34 r35 1 1 diff -r 67a42d8a1c73 wokkel/client.py 2 2 --- 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 5 6 from twisted.python import log 6 7 from twisted.words.protocols.jabber import client, error, sasl, xmlstream 7 8 -from twisted.words.protocols.jabber.jid import internJID as JID 8 9 -from twisted.words.xish import domish 10 +from twisted.words.protocols.jabber.jid import JID, internJID 9 11 +from twisted.words.xish import domish, utility 10 12 … … 12 14 -from wokkel.subprotocols import StreamManager 13 15 +from wokkel.compat import XmlStreamServerFactory 14 +from wokkel.subprotocols import StreamManager, XMPPHandlerCo ntainer16 +from wokkel.subprotocols import StreamManager, XMPPHandlerCollection 15 17 16 18 NS_CLIENT = 'jabber:client' 17 19 18 @@ -350,3 +351,13 0@@20 @@ -350,3 +351,132 @@ 19 21 reply['id'] = iq['id'] 20 22 reply.addElement((client.NS_XMPP_SESSION, 'session')) … … 44 46 + 45 47 + 46 +class ClientService(XMPPHandlerCo ntainer, service.Service):48 +class ClientService(XMPPHandlerCollection, service.Service): 47 49 + """ 48 50 + Service for accepting XMPP client connections. … … 58 60 + makes it easier to create adapters. 59 61 + 60 + As an L{xmlstream.XMPPHandlerCo ntainer}, this service creates a fake XML62 + As an L{xmlstream.XMPPHandlerCollection}, this service creates a fake XML 61 63 + stream that is passed to the XMPP subprotocol handlers. The received 62 64 + stanzas from the incoming client connections are passed on to the handlers … … 72 74 + self.port = port 73 75 + 74 + self.factory = XmlStreamServerFactory(XMPPClientListenAuthenticator, 75 + self.domain) 76 + def authenticatorFactory(): 77 + return XMPPClientListenAuthenticator(self.domain) 78 + 79 + self.factory = XmlStreamServerFactory(authenticatorFactory) 76 80 + self.factory.addBootstrap(xmlstream.STREAM_CONNECTED_EVENT, 77 81 + self.makeConnection) … … 81 85 + self.streams = {} 82 86 + 83 + XMPPHandlerCo ntainer.__init__(self)87 + XMPPHandlerCollection.__init__(self) 84 88 + 85 89 + … … 141 145 + """ 142 146 + 143 + destination = JID(element["to"]).full()147 + destination = internJID(element["to"]).full() 144 148 + 145 149 + if destination not in self.streams:
Note: See TracChangeset
for help on using the changeset viewer.