diff options
author | June McEnroe <june@causal.agency> | 2020-02-07 23:44:03 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-02-07 23:44:03 -0500 |
commit | 8b7cc1a0ed95e8a3ff413fa77eb12a3dca7fccb4 (patch) | |
tree | e43cd273a49365fefd2d3437da811bca350a56f2 /complete.c | |
parent | Update completion on join, part, privmsg (diff) | |
download | catgirl-8b7cc1a0ed95e8a3ff413fa77eb12a3dca7fccb4.tar.gz catgirl-8b7cc1a0ed95e8a3ff413fa77eb12a3dca7fccb4.zip |
Clear completion for ID on self-part
Diffstat (limited to 'complete.c')
-rw-r--r-- | complete.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/complete.c b/complete.c index 5067512..437bb7d 100644 --- a/complete.c +++ b/complete.c @@ -122,3 +122,15 @@ void completeRemove(size_t id, const char *str) { free(node); } } + +void completeClear(size_t id) { + struct Node *next = NULL; + for (struct Node *node = head; node; node = next) { + next = node->next; + if (node->id != id) continue; + if (match == node) match = NULL; + detach(node); + free(node->str); + free(node); + } +} |