From 35f347472a65eabcfd14403c1323da5631ecbf23 Mon Sep 17 00:00:00 2001 From: XeonCore Date: Sun, 12 Oct 2014 15:52:43 +1100 Subject: [PATCH] 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. --- src/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.js b/src/client.js index 657fa4f7..339b05a9 100644 --- a/src/client.js +++ b/src/client.js @@ -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);