Correct order of Presnce update

Hello,

I’m having hard time understanding how to get the updated list of contacts from external services using XIFF.

I can’t find any sample code/documentation/anything that will shed some light on this thing called XIFF.

I’m also not getting any feedback from this developer community, and I’m starting to believe XIFF was the wrong choice.

In any case, here’s a shot in the dark, maybe something will happen.

I’m specifically connecting to: MSN, YAHOO, AIM, GTALK and ICQ.

My code listens to the presense and roster events.

I see that I get different events and values if I connect to MSN or to YAHOO.

Also the order of the events is different in each case.

For example, the presence event has status, show and type fields.

Their values depend on whether the user is online/offline, the status line of the user, etc.

The status can be: ‘Yahoo messenger contact’

or it can be: ‘Offline’

It just doesn’t make any sense.

I can’t find any persistent logic that my code can work with in all cases.

Can anyone describe how the hell I should get a persistent and updated contact list for external services???

Many thanks

Ofer Bar

I believe RosterItemVO.show gets incorrectly assigned a value in the Roster class.

RosterItemVO.show, I believe, should have a value of one of the following:

Presence.SHOW_AWAY; Presence.SHOW_CHAT; Presence.SHOW_DND; Presence.SHOW_XA

But, perhaps they wanted to have some default values, until the receiving user accepts them.

I am able to assign a value for the status property and it does get updated on the server for that session. However, I haven’t been able cache that value for when the user returns in a different session. I just haven’t got this far yet in development, that is my next step. XIFF may already support this feature. The “Offline” value I reckon to be a default value.

Can you or have you set the status property for a user using XIFF?

I wish I can help you more, however XMPP is fairly new to me. Let me know if that helps. I will be working on login with correct RosterItemVO values from now on.

ps. I am not sure what version of XIFF you are developing with but I am using XIFF 3.0 beta. So there might be some differences.

Hi,

Thanks for answering, that’s refreshing on this site

I believe I am using the latest 3.0 beta (I inherited the code from someone else)

That’s the header of one of the files:

/*

Anyway, my problem is not just the values that are different from MSN to Yahoo for example, but also the order of the events.

So I am looking more for general guidelines on how to correctly read the status of contact list I get from the remote server.

Should I listen to roster events and then read the roster table?

But then the roster table doesn’t always reflect the correct status as for online/offline.

So I also listen to presence events, but that’s when I get different values in fields like status or show.

I’m also wondering if this is related to the server. We use eJabber.

Will it be different with something else? Anything recommended?

It’s really a walk in the dark.

Thanks

Ofer

I am not completely sure what you are asking, however the RosterEvent’s data property should have what you need to update the client’s roster list. Does it not? That property returns an instance of a RosterItemVO.

I’m also wondering if this is related to the server. We use eJabber.

Will it be different with something else? Anything recommended?

I don’t know if there are any differences of server types, I have only used Openfire. Perhaps you may get more replies on that question if you post else where on 404 Error - Page Not Found.

I am using a single flash instance which encapsulates the XIFF library to connect to multiple external services such as MSN, YAHOO, AIM, etc.

The wrapper code is generic and basically creates a connection to the Jabber server and then instanciates an ExternalMessenger object for each service, and calls login() on that. It also calls fetchRoster().

However, while debugging the code and data flow in various scenarios, for example when I connect to MSN vs. when I connect to Yahoo I noticed that the roster’s data is not silimar. Online status for example is not reported properly. The state is also ambigous, and depends on whether the user updates the status line on her/his side. Therefore I cannot rely to this library to function properly in all cases.

Further more, I keep discovering bugs in the code, for example, while trying to connect to an external service with the wrong password.

An error event is dispatched, and I expect that to be reported back to the application.

However, there’s no indication in the event which external service failed!

So I can’t do anything with this information except say: “hey, I got an error”

So far my experience with this code is that it’s fine to POC but not for real world applications, which is what we are trying to build.

We’ll have to throw away few months of work and try another solution.

Thanks