diff options
author | June McEnroe <june@causal.agency> | 2020-02-07 23:33:23 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-02-07 23:33:23 -0500 |
commit | d314523b90f41cfdbca867ad0ad48f2f68f66c58 (patch) | |
tree | d448e4b1cbdde3580fd2238c4a80daacb92adff4 /complete.c | |
parent | Use atexit instead of err_set_exit (diff) | |
download | catgirl-d314523b90f41cfdbca867ad0ad48f2f68f66c58.tar.gz catgirl-d314523b90f41cfdbca867ad0ad48f2f68f66c58.zip |
Update completion on join, part, privmsg
Diffstat (limited to '')
-rw-r--r-- | complete.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/complete.c b/complete.c index 8247149..5067512 100644 --- a/complete.c +++ b/complete.c @@ -109,3 +109,16 @@ void completeAccept(void) { void completeReject(void) { match = NULL; } + +void completeRemove(size_t id, const char *str) { + struct Node *next = NULL; + for (struct Node *node = head; node; node = next) { + next = node->next; + if (id && node->id != id) continue; + if (strcmp(node->str, str)) continue; + if (match == node) match = NULL; + detach(node); + free(node->str); + free(node); + } +} |