From babaac246d9d05a0c555823be16e8827561b2da8 Mon Sep 17 00:00:00 2001 From: Sebastian Hagen Date: Tue, 24 Jun 2008 20:27:12 +0200 Subject: [PATCH] Do not freak out when seeing unreal ircd wierd name flags. --- src/irc.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/irc.c b/src/irc.c index fc8ffdb..7d5c04f 100644 --- a/src/irc.c +++ b/src/irc.c @@ -1345,15 +1345,29 @@ static int irc_353(struct link_server *server, struct line *line) names = line->elemv[4]; while (*names) { - eon = names; int ovmask = 0; - /* these should be exclusive */ - if (*names == '@') { - names++; - ovmask |= NICKOP; - } else if (*names == '+') { - names++; - ovmask |= NICKVOICED; + int flagchars = 1; + /* some ircds (e.g. unreal) may display several flags for the + same nick */ + while (flagchars) { + switch (*names) { + case '@': + names++; + ovmask |= NICKOP; + break; + case '+': + names++; + ovmask |= NICKVOICED; + break; + case '%': /* unrealircd: halfop */ + case '&': /* unrealircd: protect */ + case '~': /* unrealircd: owner */ + names++; + break; + default: + flagchars = 0; + break; + } } eon = names; while (*eon && *eon != ' ')