Skip to content
Snippets Groups Projects
Commit 91540710 authored by rswindell's avatar rswindell
Browse files

Don't join the channel unless the "-j" option is used.

parent 56c39f38
No related branches found
No related tags found
No related merge requests found
......@@ -7,12 +7,16 @@ var channel="#channel";
var port=6667;
var nick="nick";
var msg;
var join=false;
for(i=0;i<argc;i++) {
switch(argv[i]) {
case "-s":
server=argv[++i];
break;
case "-j";
join=true;
break;
case "-c":
channel=argv[++i];
break;
......@@ -38,11 +42,12 @@ if (!my_server) {
while(my_server.data_waiting && (response=my_server.recvline()))
log(response);
log("Joining: " + channel);
my_server.send("JOIN " + channel + "\r\n");
while(my_server.data_waiting && (response=my_server.recvline()))
log(response);
if(join) {
log("Joining: " + channel);
my_server.send("JOIN " + channel + "\r\n");
while(my_server.data_waiting && (response=my_server.recvline()))
log(response);
}
if(msg)
send(msg);
else while(msg=readln())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment