summaryrefslogtreecommitdiff
path: root/functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'functions.c')
-rw-r--r--functions.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/functions.c b/functions.c
index 8ef2b21..54e2663 100644
--- a/functions.c
+++ b/functions.c
@@ -1596,7 +1596,7 @@ int isnickinanychannel(struct channel *channels, int maxchannelcount, char *nick
return 0;
}
-// Populate our channels struct with all nicks in a RPL_NAMREPLY
+// Populate our channels struct with all nicks in a 353 RPL_NAMREPLY
// Returns 1 on success or 0 on failure
int addnamereplytochannel(char *namereply, struct channel *channels, int maxchannelcount) {
//:irc.tghost.co.uk 353 blabounce = #blabouncer :blabounce bbnick ~@l_bratch @l_blabnc Hughbla Bratchbot ars
@@ -1609,10 +1609,12 @@ int addnamereplytochannel(char *namereply, struct channel *channels, int maxchan
// Strip the leading ':'
stripprefix(strcopy, 1);
- // Find the start of the channel name, which comes after the first '=' followed by a space
+ // Find the start of the channel name, which comes after the first '=', '*', or '@', followed by a space
+ // From RFC 2812:
+ // "@" is used for secret channels, "*" for private channels, and "=" for others (public channels).
int channelpos = -1;
for (size_t i = 0; i < strlen(strcopy) - 2; i++) {
- if (strcopy[i] == '=' && strcopy[i + 1] == ' ' && strcopy[i + 2] != '\0') {
+ if ((strcopy[i] == '=' || strcopy[i] == '*' || strcopy[i] == '@') && strcopy[i + 1] == ' ' && strcopy[i + 2] != '\0') {
// Name found
channelpos = i + 2;
break;