add PASS support - irc - Unnamed repository; edit this file 'description' to na… | |
git clone git://vernunftzentrum.de/irc.git | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 0cfe3fad8f593bcf11d495d90f158afd567b1984 | |
parent 1d3c109eb02c514ecedda65cd1bda5256ef0c6c2 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Thu, 9 Jun 2016 20:54:35 +0200 | |
add PASS support | |
Diffstat: | |
irc.c | 5 ++++- | |
1 file changed, 4 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/irc.c b/irc.c | |
@@ -756,11 +756,12 @@ main(int argc, char *argv[]) | |
{ | |
const char *user = getenv("USER"); | |
const char *ircnick = getenv("IRCNICK"); | |
+ const char *key = getenv("IRCPASS"); | |
const char *server = SRV; | |
const char *port = PORT; | |
int o; | |
- while ((o = getopt(argc, argv, "hn:u:s:p:l:")) >= 0) | |
+ while ((o = getopt(argc, argv, "hk:n:u:s:p:l:")) >= 0) | |
switch (o) { | |
case 'h': | |
case '?': | |
@@ -795,6 +796,8 @@ main(int argc, char *argv[]) | |
tinit(); | |
sfd = dial(server, port); | |
chadd("*server*", 1); | |
+ if (key) | |
+ sndf("PASS %s", key); | |
sndf("NICK %s", nick); | |
sndf("USER %s 8 * :%s", user, user); | |
sndf("MODE %s +i", nick); |