aboutsummaryrefslogtreecommitdiff
path: root/irc.c
diff options
context:
space:
mode:
Diffstat (limited to 'irc.c')
-rw-r--r--irc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/irc.c b/irc.c
index b30af48..548ee33 100644
--- a/irc.c
+++ b/irc.c
@@ -1,20 +1,12 @@
#include "irc.h"
#include "debug.h"
+#include "chanlist.h"
#include "conf.h"
#include "util.h"
int g_ircsock = -1;
-char *g_chanlist[] = {
- "a",
- "b",
- "g",
- "cg",
- "secret-channel",
-};
-const int g_nchannels = sizeof(g_chanlist)/sizeof(g_chanlist[0]);
-
int
irc_connect()
@@ -70,6 +62,14 @@ irc_handshake()
}
E(irc_sendall("JOIN #",6));
E(irc_sendall(g_chanlist[i],strlen(g_chanlist[i])));
+ if (g_chanpwlist[i] != NULL) {
+ if (strlen(g_chanpwlist[i]) > 32) {
+ fprintf(stderr,"channel password too long for #(%s)\n",g_chanlist[i]);
+ return -1;
+ }
+ E(irc_sendall(" ",1));
+ E(irc_sendall(g_chanpwlist[i],strlen(g_chanpwlist[i])));
+ }
E(irc_sendall("\r\n",2));
}
#undef E