- /* If priority formatting, this client always gets unformatted nickname. */
- if (unformatted && priority)
+ /* If priority formatting then the requested client will get the
+ unformatted nickname, and the unformatted client will get a new
+ formatted nickname. */
+ if (priority) {
+ if (formatted) {
+ /* Simply change the client's nickname to unformatted */
+ if (!silc_client_nickname_parse(client, conn, client_entry->nickname,
+ &cp))
+ return NULL;
+
+ silc_snprintf(client_entry->nickname, sizeof(client_entry->nickname),
+ cp);
+ silc_free(cp);
+ }
+
+ if (!unformatted) {
+ /* There was no other unformatted client */
+ silc_client_list_free(client, conn, clients);
+ return client_entry;
+ }
+
+ /* Now format the previously unformatted client */