From 8a689c98b4cd1f5f2b5f0b45fb7b8e3bb4f932c8 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Tue, 20 Sep 2022 17:33:37 +0200 Subject: xC: fix autocomplete in server buffers --- xC.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xC.c b/xC.c index ecb3c2d..2027a6a 100644 --- a/xC.c +++ b/xC.c @@ -13581,16 +13581,17 @@ static void complete_nicknames (struct buffer *buffer, struct completion *data, const char *word, struct strv *output) { + size_t word_len = strlen (word); if (buffer->type == BUFFER_SERVER) { struct user *self_user = buffer->server->irc_user; - if (self_user) + if (self_user && !irc_server_strncmp (buffer->server, + word, self_user->nickname, word_len)) strv_append (output, self_user->nickname); } if (buffer->type != BUFFER_CHANNEL) return; - size_t word_len = strlen (word); LIST_FOR_EACH (struct channel_user, iter, buffer->channel->users) { const char *nickname = iter->user->nickname; -- cgit v1.2.3-70-g09d2