powered by Jive Software

Roster problem

when i make changes on my roster list… let say…

deleting a roster entry…

then after i delete… i call to a procedure which update the roster list… it uses:

connection.getroster()…

but the roster entry that i deleted is still in my list… i can see him…(i have a roster jtree)…

but!!!..

when i log in the software again… the roster entry is no longer shown… it is removed from the tree.

this case also happens when i for example change a group name after i deleted the roster…

when i changed the group name… then roster entry is removed altough i deleted him before…

is it a problem of a thread?..

Gil,

when i make changes on my roster list… let say…

deleting a roster entry…

then after i delete… i call to a procedure which

update the roster list… it uses:

connection.getroster()…

Just to understand your case scenario, are you running this case between two clients? I mean, are you removing the entry in one XMPP client and “hoping” to have the other client updated? Or are you running the whole case in one client?

In either case, after an entry is deleted you don’'t have to update the roster. Smack will update the roster automatically.

but the roster entry that i deleted is still in my

list… i can see him…(i have a roster jtree)…

May be the problem is that the view (jtree) is not being refreshed? If you are running the case between two clients you can open a debugger to check if your remote client is receiving a roster update.

Regards,

– Gato

i run the program on one client to view my roster.

i have a setroster procedure which …


roster=connection.getroster();…


and then i build the tree from the begining…

i always put…

tree=null;

and built the tree from the top with the update roster

(after i did roster=connection.getroster())

but i dont see it on the tree, but the changes were happened, because when i change a group name… i dont see the change on the tree, but when i transfer one entry from one group to another… i see that the groupname is changed…

that makes me crazy… because

all i use is… roster.getgroups()…

and the groups name are updated…

but on the tree i also do this line roster.getgroups…

but in this case i dont see the new name of the group… unless i do something else…

i think its a problem of thread in smack implementation

Massive disclaimer: I haven’'t done any substantial GUI work.

Can you update the existing JTree instead of nulling it out and making a new one? I’'m not sure that the reference to the original one (with the old content) stored in the pane would go away and then be updated just because you assign null to and then rebuild the object in your procedure. That sort of thing has bitten me before.

Keith

What tree model are you using??? You should be able to simpley update the model and not null the tree.

Message was edited by: ddman

never mind i solve the problem…

the actions of deleting roster, changing his name and more

takes time…

thats why i didnt see it immidiatly

i used…

Thread.sleep

and it works great…