diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-05-16 22:09:57 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-05-16 22:09:57 +0100 |
commit | 57faf310db4c7d7d07a5695fb305c481e040e4fb (patch) | |
tree | e809f97e94c5b1ae59037c8656ba624691ca9f2c /blabouncer.c | |
parent | cfe9c969680a7a09ee60cf048f71b81d82bef1df (diff) |
Improve "listchannels" stdin debugging command.
Diffstat (limited to 'blabouncer.c')
-rw-r--r-- | blabouncer.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/blabouncer.c b/blabouncer.c index 41e0a47..7d2ea31 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -1259,6 +1259,17 @@ void dochat(int *serversockfd, int *clientsockfd, struct settings *settings) { } printf("Found channel '%s'.\n", channels[i].name); + // Store count of names so we can increment it in the loop if we encounter gaps in the names array + int namescount = getchannelnamescount(channels, channels[i].name); + // Go through each name... + for (int j = 0; j < namescount; j++) { + if (!channels[i].nicks[j][0]) { + // Skip this one and increment namescount so we find it later on instead + namescount++; + continue; + } + printf(" --> '%s' '%s' '%s'.\n", channels[i].namestype, channels[i].name, channels[i].nicks[j]); + } } printf("STDIN command complete: listchannels\n"); |