Replace illegal characters in username

When a user has an _ or any other non-alphanumeric characters in their nickname, Shout would fail to connect to some IRC servers. This replaces all non-alphanumeric characters in the nickname before sending it as the username.
This commit is contained in:
XeonCore 2014-10-12 15:52:43 +11:00
parent 40f8a4ddc4
commit 35f347472a
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ Client.prototype.connect = function(args) {
});
var nick = args.nick || "shout-user";
var username = args.username || nick;
var username = args.username || nick.replace(/[^a-zA-Z0-9]/g, '');
var realname = args.realname || "Shout User";
var irc = slate(stream);