Roster issues

Hi,

I have some issues with the roster and im not sure if it’'s a problem with XIFF or if im doing something wrong.

First of all if someone subscribes to you and you approve them, they get automatically added to your roster. Which is fine, only they’'re added with their JID as their display name which i guess is ok, but it would be good if it was optional at least.

Also, with the roster itself, people dont show up online unless they sign on while you’‘re on. If they’'re already signed on, they show up as offline when you login. And if they log out, they still show as online. Do i have to watch for these events myself or should it happen automatically?

Thank you for your help.

I will only answer the second question (the first one is a large subject, because you can do it either by changing the Xiff, or just using two simple subscriptions answering each other with a popup to ask the display name )

The second one, is, as I remember, a Xiff problem:

When you connect, you get

  1. The online users

  2. The whole Roster feeding

The problem is that the Xiff first feed its roster, and then, update if informations are available (the ones that arrives after connection, when users connects after you).

As you can see, it’'s not the correct order

My solution (for my own Xiff) was to push these values into an array while the roster isn’'t feeded. And when done, poping the datas out, and using them to feed the roster with online users.

but I think it’'s not the best solutions…

In my trace window I always see the roster arrive, then the presences follow immediately afterwards for people who are already logged in.

They’'re never in the wrong order.

The only time it happened the wrong way round was when I was experimenting with fetchRoster(), which I later found was being called automatically. I took it out and it was fine.

You mean you never call the fetch_roster function?

If I do such a thing, I don’'t get any informations…

I admit my Xiff is anything but standard Xiff, but I watched the 200B3 code and saw it was almost the same…

Do you use a specific server?

When you’‘re talking about taking fetch_roster out, it’‘s out of what? you delete the code and enjoy ? seem strange… I’'d like to code that way all my life, when things are wrong, you delete, and then there is no problem anymore…

Example of my trace:

-> the presence

RECU:

This is correct - I never call fetchRoster.

It is called automatically if the roster class has been setup before you connect to the server.

Have a look at the description of fetchRoster in the XIFF API Documentation. The Roster listens for the ‘‘login’’ event and then calls fetchRoster by itself.

The ‘‘RosterTest.as’’ example in the XIFF examples works like this.

Hope this helps.

ok… I agree with you that the problem doesn’'t come from the XIFF but from me

My problem was coming from a setPresence that was done BEFORE the login event… It’‘s stupid… I don’'t know why I did that…

Changing the place of the setPresence is recommended to avoid the inverting problem.

I choosed to put my setPresence on login event (like in the example) just to be sure not to have this problem anymore…

toastie: where is located the setPresence in your code (in an event, in initialisations…)