summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-03-10 16:00:38 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-03-10 16:00:38 +0000
commit15e716e28309b8bf7f2c59bab5f0edac59244055 (patch)
tree2880f4693a172c0ffa0f05c33ee3e1acc81efdf2 /src/irc
parentb89fb4a549846f70c5d679bd6a71f2738ffc43e1 (diff)
downloadirssi-15e716e28309b8bf7f2c59bab5f0edac59244055.zip
Added '.' to known nick flag characters. Also supports having multiple flag
chars in /NAMES list, so eg. "@+nick" works or ".@nick" which is already used by some servers. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2559 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/irc-nicklist.c25
-rw-r--r--src/irc/core/irc.h4
2 files changed, 24 insertions, 5 deletions
diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c
index 33fe31ae..b928ada0 100644
--- a/src/irc/core/irc-nicklist.c
+++ b/src/irc/core/irc-nicklist.c
@@ -78,6 +78,7 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data)
{
IRC_CHANNEL_REC *chanrec;
char *params, *type, *channel, *names, *ptr;
+ int op, halfop, voice;
g_return_if_fail(data != NULL);
@@ -112,9 +113,27 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data)
while (*names != '\0' && *names != ' ') names++;
if (*names != '\0') *names++ = '\0';
- irc_nicklist_insert(chanrec, ptr+isnickflag(*ptr),
- *ptr == '@', *ptr == '%', *ptr == '+',
- FALSE);
+ /* some servers show ".@nick", there's also been talk about
+ showing "@+nick" and since none of these chars are valid
+ nick chars, just check them until a non-nickflag char is
+ found. FIXME: we just ignore owner char now. */
+ op = halfop = voice = FALSE;
+ while (isnickflag(*ptr)) {
+ switch (*ptr) {
+ case '@':
+ op = TRUE;
+ break;
+ case '%':
+ halfop = TRUE;
+ break;
+ case '+':
+ voice = TRUE;
+ break;
+ }
+ ptr++;
+ }
+
+ irc_nicklist_insert(chanrec, ptr, op, halfop, voice, FALSE);
}
g_free(params);
diff --git a/src/irc/core/irc.h b/src/irc/core/irc.h
index 957b1e05..7006d9f6 100644
--- a/src/irc/core/irc.h
+++ b/src/irc/core/irc.h
@@ -20,8 +20,8 @@ typedef struct _REDIRECT_REC REDIRECT_REC;
(a) == '+' || (a) == '=' || (a) == '-')
#define isnickflag(a) \
- ((a) == '@' || (a) == '+' || (a) == '%' || /* op / voice / half-op */ \
- (a) == '-' || (a) == '~') /* no idea, just copied from somewhere.. */
+ ((a) == '@' || (a) == '+' || (a) == '%' || /* op / voice */ \
+ (a) == '%' || (a) == '.') /* extensions: half-op / owner */
#define ischannel(a) \
((a) == '#' || /* normal */ \