This component logs into to AIM with the given screenname and password. It then sends its logged-in OSCAR connection out of its "signal" outbox, followed by a list of any non-login-related messages it has received.
Login and wire the resulting OSCARClient up to a ChatManager:
class AIMHarness(component): def main(self): self.loginer = LoginHandler('sitar63112', 'sitar63112').activate() self.link((self.loginer, "signal"), (self, "internal inbox")) self.addChildren(self.loginer) while not self.dataReady("internal inbox"): yield 1 self.oscar = self.recv("internal inbox") queued = self.recv("internal inbox") self.unlink(self.oscar) self.chatter = ChatManager().activate() self.link((self.chatter, "heard"), (self, "outbox"), passthrough=2) self.link((self, "inbox"), (self.chatter, "talk"), passthrough=1) self.link((self.chatter, "outbox"), (self.oscar, "inbox")) self.link((self.oscar, "outbox"), (self.chatter, "inbox")) self.link((self, "internal outbox"), (self.chatter, "inbox")) while len(queued): self.send(queued, "internal outbox") del(queued) while True: yield 1 AIMHarness().run()
You can also run LoginHandler by itself. This is useful for debugging:
First, LoginHandler connects to the authorization server at login.oscar.aol.com and gets the address of the Basic Oscar Service server, the port to connect on, and an authorization cookie. It connects to the BOS server, which after some negotiation sends LoginHandler a list of the services it supports and their service versions. LoginHandler then finds out rate limits and service limitations. Then LoginHandler tells the server it is ready to begin normal operation as an AIM client.
At this point the server recognizes us as a functioning AIM client. LoginHandler unlinks its internal OSCARClient and passes the OSCARClient out of the "signal" outbox. LoginHandler also collects any additional messages from OSCARClient and sends them out of its "signal" outbox. Now any component that connects to that OSCARClient will be able to send and receive AIM messages.
LoginHandler(screenname, password, [versionNumber]) -> new LoginHandler component
Once started, LoginHandler logs in to AIM and sends the primed connection out of its "signal" outbox.
Methods defined here
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Send some parameters up to the server, then signal that we're ready to begin receiving data.
Connects to the AIM authorization server, says hi, and waits for acknowledgement.
Extracts BOS server, port, and auth cookie from server reply.
Gets BOS and auth cookie.
Requests and waits for MD5 key.
Request rate limits, wait for reply, and send acknowledgement to the server.
. Get the server's reply on rights and limitations
Gets BOS and auth cookie, negotiates protocol, and then passes the connection + any non-login-related messages out.
Does something useful with the information about rate classes that the server sends us and returns the acknowledgement we are supposed to send back to the server.
Unlink the internal OSCARClient and send it to "signal". Also collect any unused messages from OSCARClient and send them out through "signal".
Discards old connection to authorization server, connects to BOS, says hi, and waits for acknowledgement.
Request that the server tell us our rights and limitations for the services that were accepted.
Waits for supported services list from server, requests service versions, and waits for server acknowledgement of accepted service versions.
Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!
Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.
-- Automatic documentation generator, 05 Jun 2009 at 03:01:38 UTC/GMT
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.