If it’s not LDAP, then you can swap those name parts while creating new users. If it’s LDAP, then maybe those fields should already be swapped, as it will showup wrong not only in IM messenger, but also in emails, user lists, etc.
Since you are not using LDAP the appearance of a username in the Spark roster is controlled by the profile provided via the chat client. A user needs to fill out the Nickname field in the Spark profile. However they fill in this field is how users will see their name in the roster. This only holds true to is a user add to a roster after the nickname is set. Shared groups may also reflect the nickname but I do not know for sure.
It also depends on the client you are using. We use LDAP auth, and PSI as client. Spark seems to use the “CN” to get the name for display, PSI on the other hand uses the “Nickname”.
LDAP is a different game entirely. The display name in a roster is controled by a setting in the opefire properties for LDAP. In openfire 3.5.x or below it is the tag in the openfire.xml. In openfire 3.6.x it is the ldap.nameField system property that controls this.