A few API questions

1 view
Skip to first unread message

Aaron Beall

unread,
Nov 13, 2008, 2:03:17 AM11/13/08
to wimas3
I have a few API questions:

1) How do you add a buddy? I see Session.addTempBuddy() and
Session.removeBuddy(), but no Session.addBuddy()

2) How do you set your expressions, specifically a buddy icon?

3) Is it possible to set a status message for states other than away?
AIM seems to allow status messages even when available, for instance.

4) Just out of curiosity, does wimas3 use polling of the web API to
work or does it open a socket connection?

Thanks,
- Aaron

Rizwan Sattar

unread,
Nov 13, 2008, 11:51:31 AM11/13/08
to wim...@googlegroups.com
Hi Aaron!

Thanks for the questions. See inline for my answers.

On Wed, Nov 12, 2008 at 11:03 PM, Aaron Beall <con...@abeall.com> wrote:

I have a few API questions:

1) How do you add a buddy? I see Session.addTempBuddy() and
Session.removeBuddy(), but no Session.addBuddy()

We have an addBuddy call in Session, it's signature is:
public function addBuddy(buddyName:String, groupName:String, authorizationMsg:String=null, preAuthorized:Boolean=false):void
 


2) How do you set your expressions, specifically a buddy icon?

We haven't yet implemented setting expressions, but we are planning to in the short term. For AIR and Flash 10, we will be able to support loading images from the user's computer (at their request) to upload as a buddy icon.

The typical process in AIM is to choose a pre-set icon, get it's unique id and call setExpression with that id. However, we'd like to deliver that when we can also uploadExpressions, because I feel that people will want to use custom icons more than the pre-defined ones.

FYI, wimas3 is an implementation of the WIM APIs defined here:

http://dev.aol.com/aim/web/serverapi_reference

 


3) Is it possible to set a status message for states other than away?
AIM seems to allow status messages even when available, for instance.

AIM allows you to set a status message when you are online, and an away message when you are away. Unfortunately they are coupled with each other, but if you check out AIM Express (which is built on wimas3), we've "decoupled" the status messsage across states (in AIM Express code), so the status stays persistent.

To set a statusMessage, check out the statusMessage function:

public function setStatusMsg(statusMsg:String):void
 


4) Just out of curiosity, does wimas3 use polling of the web API to
work or does it open a socket connection?

Great question! wimas3 uses a "comet" technique (Check out http://en.wikipedia.org/wiki/Comet_(programming) and http://alex.dojotoolkit.org/2006/03/comet-low-latency-data-for-the-browser/) to get asynchronous events from the server. The basic method is this:

1) We make a "fetchEvents" HTTP request to the server.
2) The server holds onto the request for up to 30 seconds (can be configurable to be much longer)
3) If the server gets any events, it will return a response immediately (so you'll get a response before the 30 seconds are up).
4) If the server doesn't get any events at 30 seconds, it returns a response with a "timeToNextFetch" property and a new url to fetch from, so the process can start back at step 1.

The steps above are taken care of for you by the Session class, so you just have to register the events and it will take care of the fetchEvents logic (as well as reconnection logic, in case of a disconnect).

Thanks,
Rizwan
 


Thanks,
- Aaron


Aaron Beall

unread,
Nov 13, 2008, 3:37:44 PM11/13/08
to wimas3
Thanks for the quick response!

1) Ah, excellent. So the documentation just doesn't have this in there
yet, then? I'm looking under Session in the docs and I don't see it,
but I see addBuddy in the source. Are there undoc'd methods for
modifying the buddy list? Like addGroup, removeGroup, renameGroup,
moveBuddy?

2) Awesome, I totally agree that being able to upload a custom image
for the icon is a smart way to go. I know at least for me and pretty
much everyone I know we use custom icons (mostly headshots of us.)
Will the API allow for a custom file reference UI? For instance, say I
wanted to implement AIR's drag and drop to select the file, then let
the user make some modification in my app to the image or resize it in
AIR, save the image to a temp file and upload that when ready?

3) Okay, I get it now. Yes, I like how AIM Express decouples the away/
status messages from the states. So, from the API, if I setStatusMsg,
then I setState to away with a message, then I setState back to
available, would the status message still be there, or would it be
cleared? In other words, is status message basically persistent across
all states, but overwritten by the away message when in the away
state?

4) That's really cool, I've not heard of comet before. Pretty clever!

So, as I'm looking at the WIM API reference it looks quite
comprehensive. As I understand, wimas3 is an AS3 implementation that
takes care of all the details for you to interact with this API (an
API for an API :)), but it's still a work in progress so not all the
WIM API's are there yet. Sounds like it's under very active
development. Is there a roadmap for allowing file transfers? Will
Video and Audio chat every be available?

This project is really exciting. I'm an old school Flash designer/
developer and just always wanted to make my own personal just-the-
stuff-I-need AIM client. Right now I use Trillian and Pidgen, between
the two they almost do all I want, neither do by themself, and they
both do a ton more than I want (I don't really need other networks
than AIM for one thing.) So, thanks!

- Aaron

On Nov 13, 11:51 am, "Rizwan Sattar" <rsat...@gmail.com> wrote:
> Hi Aaron!
>
> Thanks for the questions. See inline for my answers.
>
> Great question! wimas3 uses a "comet" technique (Check outhttp://en.wikipedia.org/wiki/Comet_(programming) andhttp://alex.dojotoolkit.org/2006/03/comet-low-latency-data-for-the-br...)
Reply all
Reply to author
Forward
0 new messages