Send SETNAME command if user edits realname field
This commit is contained in:
parent
d8b49f0fa5
commit
5d560c99b8
@ -173,6 +173,7 @@ Network.prototype.createWebIrc = function(client) {
|
||||
|
||||
Network.prototype.edit = function(client, args) {
|
||||
const oldNick = this.nick;
|
||||
const oldRealname = this.realname;
|
||||
|
||||
this.nick = args.nick;
|
||||
this.host = String(args.host || "");
|
||||
@ -198,8 +199,10 @@ Network.prototype.edit = function(client, args) {
|
||||
}
|
||||
|
||||
if (this.irc) {
|
||||
const connected = this.irc.connection && this.irc.connection.connected;
|
||||
|
||||
if (this.nick !== oldNick) {
|
||||
if (this.irc.connection && this.irc.connection.connected) {
|
||||
if (connected) {
|
||||
// Send new nick straight away
|
||||
this.irc.raw("NICK", this.nick);
|
||||
} else {
|
||||
@ -213,6 +216,10 @@ Network.prototype.edit = function(client, args) {
|
||||
}
|
||||
}
|
||||
|
||||
if (connected && this.realname !== oldRealname) {
|
||||
this.irc.raw("SETNAME", this.realname);
|
||||
}
|
||||
|
||||
this.irc.options.host = this.host;
|
||||
this.irc.options.port = this.port;
|
||||
this.irc.options.password = this.password;
|
||||
|
Loading…
Reference in New Issue
Block a user