Skip to content
Snippets Groups Projects
Commit b45c2678 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add '-p' option to over-ride password sent to server via PASS message

If -p (or -P) is the last option given with no argument following, then no
password would be sent to the server (via PASS message).

For Odusseus71
parent 18d4e2f8
Branches
Tags
1 merge request!455Update branch with changes from master
...@@ -89,6 +89,7 @@ var client_cmds = { ...@@ -89,6 +89,7 @@ var client_cmds = {
/* Command-line options go BEFORE command-line args */ /* Command-line options go BEFORE command-line args */
var irc_theme = "irc-default.js"; var irc_theme = "irc-default.js";
var user_password = user.security.password;
ARGPARSE: for (cmdarg=0;cmdarg<argc;cmdarg++) { ARGPARSE: for (cmdarg=0;cmdarg<argc;cmdarg++) {
switch(argv[cmdarg]) { switch(argv[cmdarg]) {
case "-A": case "-A":
...@@ -99,6 +100,10 @@ ARGPARSE: for (cmdarg=0;cmdarg<argc;cmdarg++) { ...@@ -99,6 +100,10 @@ ARGPARSE: for (cmdarg=0;cmdarg<argc;cmdarg++) {
case "-t": case "-t":
irc_theme=argv[++cmdarg]; irc_theme=argv[++cmdarg];
break; break;
case "-P":
case "-p":
user_password = argv[++cmdarg];
break;
default: default:
break ARGPARSE; break ARGPARSE;
} }
...@@ -130,7 +135,8 @@ if(!sock.connect(irc_server,irc_port)) { ...@@ -130,7 +135,8 @@ if(!sock.connect(irc_server,irc_port)) {
clean_exit(); clean_exit();
} }
send_cmd("PASS", user.security.password); // for use with JS IRC server if(user_password)
send_cmd("PASS", user_password);
if (nick=="") if (nick=="")
nick=user.alias; nick=user.alias;
nick=nick.replace(/\s+/g,"_"); nick=nick.replace(/\s+/g,"_");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment