Skip to content

Commit

Permalink
Merge pull request #840 from igniterealtime/SPARK-2331
Browse files Browse the repository at this point in the history
SPARK-2331 Spark sets a nickname even if it is forbidden
  • Loading branch information
Plyha authored May 11, 2023
2 parents 98164a6 + 5eadf69 commit ca028f3
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,12 +481,14 @@ private void saveVCard() {
}

try {
final VCardManager vcardManager = SparkManager.getVCardManager();
vcardManager.setPersonalVCard(vcard);

// Save vcard on server
org.jivesoftware.smackx.vcardtemp.VCardManager smackVCardManager = org.jivesoftware.smackx.vcardtemp.VCardManager.getInstanceFor( SparkManager.getConnection() );
smackVCardManager.saveVCard( vcard );

// Save vcard on client
final VCardManager vcardManager = SparkManager.getVCardManager();
vcardManager.setPersonalVCard(vcard);

// Notify users.
if (avatarBytes != null) {
Presence presence = SparkManager.getWorkspace().getStatusBar()
Expand All @@ -498,7 +500,7 @@ private void saveVCard() {
// Change my own presence
SparkManager.getSessionManager().changePresence(newPresence);

// Chnage avatar in status bar.
// Change avatar in status bar.
StatusBar statusBar = SparkManager.getWorkspace()
.getStatusBar();
statusBar.setAvatar(new ImageIcon(vcard.getAvatar()));
Expand Down

0 comments on commit ca028f3

Please sign in to comment.