How to set my name in smack?

I can use connection.getRoster (), getName to get a list of contact names. But how to set the name of the current authenticated account?

+2
source share
1 answer

Log in with a different account? :)

Seriously, your account name is tied to your authentication, and there is no way to force the other side to use a specific alias for you, but if both parties implement XEP-172 , you can send a hint to the other side when signing:

<presence from=' narrator@moby-dick.lit ' to=' starbuck@moby-dick.lit ' type='subscribe'> <nick xmlns='http://jabber.org/protocol/nick'>Ishmael</nick> </presence> 
+1
source

All Articles