powered by Jive Software

SubscriptionDialog.java - Getting nickname

Hi!

When a user adds another user the subscription request that is sent will pop-up with a nickname just containing the jabber id. (Running LDAP and AD-integrated). I would like to pick upp the Vcard nick-name and use it instead. I have been trying to get it to work by adding the code below, but i just causes the Subscription dialog to not appear… I would be very greatful if anyone could help me.

String nickname = SparkManager.getVCardManager().getVCard(jid).getNickName();

**
**

**if ( nickname == null){
nickname = “”;
}

nicknameField.setText(nickname);**

Single stepping the code will abort as soon as it gets to the line where getVCard is involved…

I am not very experienced in writing java, but in C/C++ so it could just be lack of understanding…

Thanks!

I will answere my own question… There seems to be a problem when using the nickname. I have changed the code to use fn and ln instead and it works.

In the function invoke I have changed the code for setting the nicknameField to the below.

** String fn = SparkManager.getVCardManager().getVCard(jid).getFirstName();
if (fn == null) {
fn="";
}
String ln = SparkManager.getVCardManager().getVCard(jid).getLastName();
if (ln == null) {
ln="";
}
String nickname = fn + ’ ’ + ln;

    nicknameField.setText(nickname);**