Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change your own name using Smack?

Tags:

java

xmpp

smack

You can use RosterEntry to get the name of your contacts. But how I change my own name and it appears to my contacts when they do

RosterEntry entry = roster.getEntries("myuser");
entry.getName(); // It needs to show my updated name

Thanks in advance.

like image 866
Marcellus Andrade Avatar asked May 24 '11 14:05

Marcellus Andrade


1 Answers

As long as the other users haven't set a custom nickname for you, I think Spark will display your first and last name, which you may be able to change with:

VCard me = new VCard();
me.load(conn); // load own VCard
me.setFirstName("John");
me.setLastName("Doe");
me.save(conn);
like image 113
Brad Mace Avatar answered Nov 09 '22 11:11

Brad Mace