summaryrefslogtreecommitdiff
path: root/xC.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-09-20 17:33:37 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-09-20 17:34:01 +0200
commit8a689c98b4cd1f5f2b5f0b45fb7b8e3bb4f932c8 (patch)
tree0a7b2c8640a831e092f4226e24f91a1ea5297f54 /xC.c
parent9327333813cbcb538f6757934be42d59c34f86d6 (diff)
downloadxK-8a689c98b4cd1f5f2b5f0b45fb7b8e3bb4f932c8.tar.gz
xK-8a689c98b4cd1f5f2b5f0b45fb7b8e3bb4f932c8.tar.xz
xK-8a689c98b4cd1f5f2b5f0b45fb7b8e3bb4f932c8.zip
xC: fix autocomplete in server buffers
Diffstat (limited to 'xC.c')
-rw-r--r--xC.c5
1 files 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;