Default to Name or Nickname on subscription request dialog

Description

When subscription request pops up in Spark when someone wants to add you to their roster, Spark shows their username and then prepopulates the Nickname field with their username as well. Nickname field can be edited before approving the request and adding this user to your contacts, but sometimes username can be undistinguishable (especially in closed environment, when username can be just numbers or some other code). So it could be useful for Spark to try to pull user's Name or Nickname first and only then fallback to username (or nothing actually, leaving it up to a user to name his new contact).

Environment

None

Activity

Show:
wroot
November 27, 2016, 11:43 AM

The code is in https://github.com/igniterealtime/Spark/blob/master/src/java/org/jivesoftware/spark/ui/SubscriptionDialog.java at 197 line

Currently it assigns field Nickname with a value of a jid stripped of its second part (username). I think it should be possible to load a vCard of that user and pull his name or nickname and do try-catch here in order: name, nickname, username.

wroot
December 18, 2016, 11:32 AM

I'm starting to think maybe that's not possible to fetch user's nickname when he is not in your roster yet. SparkManager.UserManager()getUserNicknameFromJID(jid) can't do that and still pulls the username.

Assignee

Unassigned

Reporter

wroot

Expected Effort

None

Ignite Forum URL

None

Components

Affects versions

Priority

Minor
Configure