From d314523b90f41cfdbca867ad0ad48f2f68f66c58 Mon Sep 17 00:00:00 2001 From: C. McEnroe Date: Fri, 7 Feb 2020 23:33:23 -0500 Subject: Update completion on join, part, privmsg --- complete.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'complete.c') 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); + } +} -- cgit 1.4.1-2-gfad0