Debug away msg when no client on.
This commit is contained in:
parent
c13c58157b
commit
38f84edc01
|
@ -1,3 +1,7 @@
|
||||||
|
2006-09-25 Arnaud Cornet <arnaud.cornet@gmail.com>
|
||||||
|
|
||||||
|
* *: Debug no_client_away_msg.
|
||||||
|
|
||||||
2006-09-23 Arnaud Cornet <arnaud.cornet@gmail.com>
|
2006-09-23 Arnaud Cornet <arnaud.cornet@gmail.com>
|
||||||
|
|
||||||
* src/irc.c: Untested oidentd IPV6 support.
|
* src/irc.c: Untested oidentd IPV6 support.
|
||||||
|
@ -6,7 +10,7 @@
|
||||||
|
|
||||||
* src/bip.c: umask for better permissions when using in system mode.
|
* src/bip.c: umask for better permissions when using in system mode.
|
||||||
* src/irc.c: added no_client_away_msg configuration directive and
|
* src/irc.c: added no_client_away_msg configuration directive and
|
||||||
code.
|
code as well as support for multiple on_connect_send.
|
||||||
|
|
||||||
2006-07-02 Arnaud Cornet <arnaud.cornet@gmail.com>
|
2006-07-02 Arnaud Cornet <arnaud.cornet@gmail.com>
|
||||||
|
|
||||||
|
|
8
TODO
8
TODO
|
@ -1,5 +1,4 @@
|
||||||
- uid, gid
|
- uid, gid
|
||||||
- multiple on_connect_send
|
|
||||||
- keep invites when detached ?
|
- keep invites when detached ?
|
||||||
- allow global (or per net ?) IP filtering
|
- allow global (or per net ?) IP filtering
|
||||||
- more /bip commands
|
- more /bip commands
|
||||||
|
@ -23,10 +22,3 @@ Thanks a lot for your help.
|
||||||
Best regards,
|
Best regards,
|
||||||
Whoopie
|
Whoopie
|
||||||
--
|
--
|
||||||
Donner des droits plus méchants au log global
|
|
||||||
|
|
||||||
DONE:
|
|
||||||
|
|
||||||
11:23 < KiBi> Un /away truc chose automatique quand plus aucun client n'est
|
|
||||||
attaché.
|
|
||||||
- in english: automatic command when no more client is connected
|
|
||||||
|
|
21
src/bip.c
21
src/bip.c
|
@ -395,6 +395,8 @@ void c_connection_free(struct c_connection *c)
|
||||||
}
|
}
|
||||||
|
|
||||||
free(c->away_nick);
|
free(c->away_nick);
|
||||||
|
free(c->no_client_away_msg);
|
||||||
|
|
||||||
char *s;
|
char *s;
|
||||||
while ((s = list_remove_first(&c->on_connect_send)))
|
while ((s = list_remove_first(&c->on_connect_send)))
|
||||||
free(s);
|
free(s);
|
||||||
|
@ -457,8 +459,10 @@ static int add_connection(list_t *connectionl, list_t *data,
|
||||||
case LEX_AWAY_NICK:
|
case LEX_AWAY_NICK:
|
||||||
c->away_nick = t->pdata;
|
c->away_nick = t->pdata;
|
||||||
break;
|
break;
|
||||||
|
case LEX_NO_CLIENT_AWAY_MSG:
|
||||||
|
c->no_client_away_msg = t->pdata;
|
||||||
|
break;
|
||||||
case LEX_ON_CONNECT_SEND:
|
case LEX_ON_CONNECT_SEND:
|
||||||
printf("lex: %s\n", t->pdata);
|
|
||||||
list_add_last(&c->on_connect_send, t->pdata);
|
list_add_last(&c->on_connect_send, t->pdata);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -816,13 +820,6 @@ void ircize(list_t *ll)
|
||||||
link->follow_nick = c->follow_nick;
|
link->follow_nick = c->follow_nick;
|
||||||
link->ignore_first_nick = c->ignore_first_nick;
|
link->ignore_first_nick = c->ignore_first_nick;
|
||||||
|
|
||||||
list_iterator_t ocsit;
|
|
||||||
for (list_it_init(&c->on_connect_send, &ocsit);
|
|
||||||
list_it_item(&ocsit);
|
|
||||||
list_it_next(&ocsit)) {
|
|
||||||
printf("yo:%s\n", list_it_item(&ocsit));
|
|
||||||
}
|
|
||||||
|
|
||||||
char *s;
|
char *s;
|
||||||
while ((s = list_remove_first(
|
while ((s = list_remove_first(
|
||||||
&link->on_connect_send))) {
|
&link->on_connect_send))) {
|
||||||
|
@ -831,12 +828,6 @@ void ircize(list_t *ll)
|
||||||
list_append(&c->on_connect_send,
|
list_append(&c->on_connect_send,
|
||||||
&link->on_connect_send);
|
&link->on_connect_send);
|
||||||
|
|
||||||
for (list_it_init(&link->on_connect_send, &ocsit);
|
|
||||||
list_it_item(&ocsit);
|
|
||||||
list_it_next(&ocsit)) {
|
|
||||||
printf("fin:%s\n", (char *)list_it_item(&ocsit));
|
|
||||||
}
|
|
||||||
|
|
||||||
link->away_nick = strmaydup(c->away_nick);
|
link->away_nick = strmaydup(c->away_nick);
|
||||||
|
|
||||||
link->no_client_away_msg =
|
link->no_client_away_msg =
|
||||||
|
@ -1063,7 +1054,7 @@ int ssl_check_trust(struct link_client *ic)
|
||||||
if(!LINK(ic)->untrusted_certs ||
|
if(!LINK(ic)->untrusted_certs ||
|
||||||
sk_X509_num(LINK(ic)->untrusted_certs) <= 0)
|
sk_X509_num(LINK(ic)->untrusted_certs) <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
trustcert = sk_X509_value(LINK(ic)->untrusted_certs, 0);
|
trustcert = sk_X509_value(LINK(ic)->untrusted_certs, 0);
|
||||||
strcpy(subject, "Subject: ");
|
strcpy(subject, "Subject: ");
|
||||||
strcpy(issuer, "Issuer: ");
|
strcpy(issuer, "Issuer: ");
|
||||||
|
|
|
@ -187,6 +187,8 @@ con_command:
|
||||||
LEX_CHANNEL, $3); }
|
LEX_CHANNEL, $3); }
|
||||||
| LEX_ON_CONNECT_SEND LEX_EQ LEX_STRING { $$ = tuple_s_new(
|
| LEX_ON_CONNECT_SEND LEX_EQ LEX_STRING { $$ = tuple_s_new(
|
||||||
LEX_ON_CONNECT_SEND, $3); }
|
LEX_ON_CONNECT_SEND, $3); }
|
||||||
|
| LEX_NO_CLIENT_AWAY_MSG LEX_EQ LEX_STRING { $$ = tuple_s_new(
|
||||||
|
LEX_NO_CLIENT_AWAY_MSG, $3); }
|
||||||
channel:
|
channel:
|
||||||
{ $$ = list_new(NULL); }
|
{ $$ = list_new(NULL); }
|
||||||
| channel cha_command LEX_SEMICOLON { list_add_last($1, $2); $$ = $1; }
|
| channel cha_command LEX_SEMICOLON { list_add_last($1, $2); $$ = $1; }
|
||||||
|
|
17
src/irc.c
17
src/irc.c
|
@ -321,10 +321,19 @@ static void irc_server_connected(struct link_server *server)
|
||||||
list_it_item(&itocs); list_it_next(&itocs)) {
|
list_it_item(&itocs); list_it_next(&itocs)) {
|
||||||
ssize_t len = strlen(list_it_item(&itocs)) + 2;
|
ssize_t len = strlen(list_it_item(&itocs)) + 2;
|
||||||
char *str = malloc(len + 1);
|
char *str = malloc(len + 1);
|
||||||
sprintf(str, "%s\r\n", list_it_item(&itocs));
|
sprintf(str, "%s\r\n", (char *)list_it_item(&itocs));
|
||||||
write_line(CONN(server), str);
|
write_line(CONN(server), str);
|
||||||
free(str);
|
free(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (LINK(server)->l_clientc == 0) {
|
||||||
|
if (LINK(server)->away_nick)
|
||||||
|
WRITE_LINE1(CONN(server), NULL, "NICK",
|
||||||
|
LINK(server)->away_nick);
|
||||||
|
if (LINK(server)->no_client_away_msg)
|
||||||
|
WRITE_LINE1(CONN(server), NULL, "AWAY",
|
||||||
|
LINK(server)->no_client_away_msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int who_arg_to_ovmask(char *str)
|
static int who_arg_to_ovmask(char *str)
|
||||||
|
@ -829,10 +838,8 @@ static int irc_cli_startup(struct link_client *ic, struct line *line,
|
||||||
LINK(server)->connect_nick);
|
LINK(server)->connect_nick);
|
||||||
|
|
||||||
/* change away status */
|
/* change away status */
|
||||||
if (LINK(ic)->l_clientc == 0) {
|
if (server && LINK(ic)->no_client_away_msg)
|
||||||
if (server && LINK(ic)->no_client_away_msg)
|
WRITE_LINE0(CONN(server), NULL, "AWAY");
|
||||||
WRITE_LINE0(CONN(server), NULL, "AWAY");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(initmask);
|
free(initmask);
|
||||||
|
|
Loading…
Reference in New Issue