|
@@ -1020,15 +1020,15 @@ JitsiConference.prototype.setDisplayName = function(name) {
|
1020
|
1020
|
if (this.room) {
|
1021
|
1021
|
const nickKey = 'nick';
|
1022
|
1022
|
|
1023
|
|
- // if there is no display name already set, avoid setting an empty one
|
1024
|
|
- if (!name && !this.room.getFromPresence(nickKey)) {
|
1025
|
|
- return;
|
|
1023
|
+ if (name) {
|
|
1024
|
+ this.room.addOrReplaceInPresence(nickKey, {
|
|
1025
|
+ attributes: { xmlns: 'http://jabber.org/protocol/nick' },
|
|
1026
|
+ value: name
|
|
1027
|
+ }) && this.room.sendPresence();
|
|
1028
|
+ } else if (this.room.getFromPresence(nickKey)) {
|
|
1029
|
+ this.room.removeFromPresence(nickKey);
|
|
1030
|
+ this.room.sendPresence();
|
1026
|
1031
|
}
|
1027
|
|
-
|
1028
|
|
- this.room.addOrReplaceInPresence(nickKey, {
|
1029
|
|
- attributes: { xmlns: 'http://jabber.org/protocol/nick' },
|
1030
|
|
- value: name
|
1031
|
|
- }) && this.room.sendPresence();
|
1032
|
1032
|
}
|
1033
|
1033
|
};
|
1034
|
1034
|
|