diff options
author | C. McEnroe | 2020-02-08 18:29:01 -0500 |
---|---|---|
committer | C. McEnroe | 2020-02-08 18:29:01 -0500 |
commit | f502260dd0aa73b09bfbb7289b50a67592866166 (patch) | |
tree | 66c829e80fc3968b3ffcabc2b11fc25acbc610c8 /command.c | |
parent | 156282c95d523b0c19f5409eb15cd53fc3211894 (diff) |
Scan messages for URLs
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/command.c b/command.c index eaabc9c..4100928 100644 --- a/command.c +++ b/command.c @@ -144,6 +144,16 @@ static void commandClose(size_t id, char *params) { } } +static void commandOpen(size_t id, char *params) { + if (!params) { + urlOpenCount(id, 1); + } else if (isdigit(params[0])) { + urlOpenCount(id, strtoul(params, NULL, 10)); + } else { + urlOpenMatch(id, params); + } +} + static const struct Handler { const char *cmd; Command *fn; @@ -155,6 +165,7 @@ static const struct Handler { { "/names", commandNames }, { "/nick", commandNick }, { "/notice", commandNotice }, + { "/open", commandOpen }, { "/part", commandPart }, { "/query", commandQuery }, { "/quit", commandQuit }, |