diff --git a/src/inc/clients/irc/welcome.js b/src/inc/clients/irc/welcome.js index 743f3a8..f644b28 100644 --- a/src/inc/clients/irc/welcome.js +++ b/src/inc/clients/irc/welcome.js @@ -1,6 +1,5 @@ module.exports = client => { client._cmd.set("001", function (msg) { // welcome - this.server.me = msg.params[0]; this.join(this.options.channels); this.emit("data", ["connected", msg.params[1]]); }.bind(client)); diff --git a/src/inc/clients/irc/whois.js b/src/inc/clients/irc/whois.js index d78a680..bd6d3a9 100644 --- a/src/inc/clients/irc/whois.js +++ b/src/inc/clients/irc/whois.js @@ -1,3 +1,5 @@ +import { getLevel } from "../../admin.js"; + module.exports = client => { client._cmd.set("307", function (msg) { // whois_identified (ircd-hybrid) let tmpuser = {}; @@ -16,7 +18,7 @@ module.exports = client => { tmpuser.username = msg.params[2]; tmpuser.hostname = msg.params[3]; tmpuser.realname = msg.params[5]; - tmpuser.prefix = `${msg.params[2]}!${msg.params[5]}@${msg.params[3]}`; + tmpuser.prefix = `${msg.params[1]}!${msg.params[2]}@${msg.params[3]}`; this.server.user.set(msg.params[1], tmpuser); }.bind(client)); @@ -44,6 +46,8 @@ module.exports = client => { channels: tmpuser.channels || [], cached: ~~(Date.now() / 1000) }; + if(msg.params[0] === msg.params[1]) + this.server.me = tmpuser; this.server.user.set(msg.params[1], tmpuser); }.bind(client));