commit fab1c5d11a72152fab61f8fe9429cbbe1eb213dd
parent 08617d35f06b557a7e98f67d5ca0cabbdf767207
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Sun, 7 Aug 2011 03:13:49 -0400
add no-destination-prefix flag
Diffstat:
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/irctk.c b/irctk.c
@@ -125,10 +125,10 @@ static struct argp_option options[] = {
/*{"no-command-to-event", 0, 0, 0,
"Don't generate events from messages with \"/quit\", \"/me\"...",
- PARSING, }, // TODO
- {"no-destination-prefix", 0, 0, 0,
+ PARSING, }, */ // TODO
+ {"no-destination-prefix", 'D', 0, 0,
"Don't look for []",
- PARSING}, // TODO */
+ PARSING},
{"event-to-nothing", 'n', 0, 0,
"Ignore server events (default).",
PARSING},
@@ -169,6 +169,7 @@ struct arguments
int default_destination;
int show_inferred;
+ int destination_prefix;
int with_host;
int own;
@@ -211,6 +212,7 @@ void initialize_args()
args.default_destination = DEFAULT_LAST_IN;
args.show_inferred = 0;
+ args.destination_prefix = 1;
args.with_host = 0;
args.own = 0;
@@ -298,6 +300,9 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state)
case 'P':
arguments->show_inferred = 1;
break;
+ case 'D':
+ arguments->destination_prefix = 0;
+ break;
case 'N':
arguments->force_nick = 1;
break;
@@ -1000,7 +1005,7 @@ int start (int max_wait)
usleep(args.interval - tp);
first = 0;
- if (line[0] == '[')
+ if (line[0] == '[' && args.destination_prefix)
{
int i=0;
char *msg;