summary refs log tree commit diff
path: root/complete.c
diff options
context:
space:
mode:
authorC. McEnroe2020-02-07 23:33:23 -0500
committerC. McEnroe2020-02-07 23:33:23 -0500
commitd314523b90f41cfdbca867ad0ad48f2f68f66c58 (patch)
treed448e4b1cbdde3580fd2238c4a80daacb92adff4 /complete.c
parentef9bea6d601742b8e91eda59b914f8653463ef24 (diff)
Update completion on join, part, privmsg
Diffstat (limited to 'complete.c')
-rw-r--r--complete.c13
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);
+	}
+}