From 18391624211734f9d4a4073ac655c625cb8ea28f Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Wed, 24 Sep 2014 20:03:58 +0900 Subject: [PATCH] Add username field to user info. Most of the networks don't allow unicode username. This patch allows users to specify username optionally. When specified, username is used for connecting IRC networks instead of nickname. --- src/client.js | 3 ++- users/example/user.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.js b/src/client.js index 1fc6289c..bd035de7 100644 --- a/src/client.js +++ b/src/client.js @@ -138,6 +138,7 @@ Client.prototype.connect = function(args) { }); var nick = args.nick || "shout-user"; + var username = args.username || nick; var realname = args.realname || "Shout User"; var irc = slate(stream); @@ -148,7 +149,7 @@ Client.prototype.connect = function(args) { irc.me = nick; irc.nick(nick); - irc.user(nick, realname); + irc.user(username, realname); var network = new Network({ host: server.host, diff --git a/users/example/user.json b/users/example/user.json index f0fe9f79..cc7c7704 100644 --- a/users/example/user.json +++ b/users/example/user.json @@ -9,6 +9,7 @@ "tls": true, "password": "serverpw", "nick": "john", + "username": "john", "realname": "John Doe", "commands": [ "/msg NickServ identify password",