Add -k option for joining with keys
parent
426be32b1d
commit
906440968e
|
@ -13,6 +13,7 @@
|
|||
.Op Fl a Ar auth
|
||||
.Op Fl h Ar host
|
||||
.Op Fl j Ar chan
|
||||
.Op Fl k Ar keys
|
||||
.Op Fl l Ar path
|
||||
.Op Fl n Ar nick
|
||||
.Op Fl p Ar port
|
||||
|
@ -58,6 +59,12 @@ after connecting.
|
|||
.Ar chan
|
||||
may be a comma-separated list.
|
||||
.
|
||||
.It Fl k Ar keys
|
||||
Set keys for channels in
|
||||
.Fl j .
|
||||
.Ar keys
|
||||
may be a comma-separated list.
|
||||
.
|
||||
.It Fl l Ar path
|
||||
Log messages to
|
||||
subdirectories of
|
||||
|
|
3
chat.c
3
chat.c
|
@ -53,13 +53,14 @@ int main(int argc, char *argv[]) {
|
|||
setlocale(LC_CTYPE, "");
|
||||
|
||||
int opt;
|
||||
while (0 < (opt = getopt(argc, argv, "NW:a:h:j:l:n:p:r:u:vw:"))) {
|
||||
while (0 < (opt = getopt(argc, argv, "NW:a:h:j:k:l:n:p:r:u:vw:"))) {
|
||||
switch (opt) {
|
||||
break; case 'N': self.notify = true;
|
||||
break; case 'W': self.webp = dupe(optarg);
|
||||
break; case 'a': self.auth = dupe(optarg);
|
||||
break; case 'h': self.host = dupe(optarg);
|
||||
break; case 'j': self.join = dupe(optarg);
|
||||
break; case 'k': self.keys = dupe(optarg);
|
||||
break; case 'l': logOpen(optarg);
|
||||
break; case 'n': self.nick = dupe(optarg);
|
||||
break; case 'p': self.port = dupe(optarg);
|
||||
|
|
1
chat.h
1
chat.h
|
@ -43,6 +43,7 @@ struct {
|
|||
char *user;
|
||||
char *real;
|
||||
char *join;
|
||||
char *keys;
|
||||
bool raw;
|
||||
bool notify;
|
||||
bool quit;
|
||||
|
|
6
handle.c
6
handle.c
|
@ -138,7 +138,11 @@ static void handleReplyWelcome(char *prefix, char *params) {
|
|||
self.nick = strdup(nick);
|
||||
if (!self.nick) err(EX_OSERR, "strdup");
|
||||
}
|
||||
if (self.join) ircFmt("JOIN %s\r\n", self.join);
|
||||
if (self.join && self.keys) {
|
||||
ircFmt("JOIN %s %s\r\n", self.join, self.keys);
|
||||
} else if (self.join) {
|
||||
ircFmt("JOIN %s\r\n", self.join);
|
||||
}
|
||||
tabTouch(TagStatus, self.nick);
|
||||
|
||||
uiLog(TagStatus, UICold, L"You have arrived");
|
||||
|
|
Loading…
Reference in New Issue