summaryrefslogtreecommitdiff
path: root/src/irc/core/irc-nicklist.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@0x90.dk>2014-06-29 14:32:15 +0200
committerAlexander Færøy <ahf@0x90.dk>2014-06-29 14:32:15 +0200
commit2b6bba3fd2019158990f13d9e8913fd3bbb20b61 (patch)
treeb2bff7951f6f831e0759b509ce0f2160f203d961 /src/irc/core/irc-nicklist.c
parentaaa0cb6e031b067f4d94abda2ccfc2e0ed1ecf7c (diff)
parent6accf509915244aa89f58bd89d95f503c95299b9 (diff)
downloadirssi-2b6bba3fd2019158990f13d9e8913fd3bbb20b61.zip
Merge pull request #62 from dgl/prefix-nick-flags
Use PREFIX from 005 to decide if a nick flag is of op level
Diffstat (limited to 'src/irc/core/irc-nicklist.c')
-rw-r--r--src/irc/core/irc-nicklist.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c
index cbf8b9fa..da9d4aca 100644
--- a/src/irc/core/irc-nicklist.c
+++ b/src/irc/core/irc-nicklist.c
@@ -106,6 +106,7 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data)
char *params, *type, *channel, *names, *ptr, *host;
int op, halfop, voice;
char prefixes[MAX_USER_PREFIXES+1];
+ const char *nick_flags, *nick_flag_cur, *nick_flag_op;
g_return_if_fail(data != NULL);
@@ -117,6 +118,8 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data)
g_free(params);
return;
}
+ nick_flags = server->get_nick_flags(SERVER(server));
+ nick_flag_op = strchr(nick_flags, '@');
/* type = '=' = public, '*' = private, '@' = secret.
@@ -158,6 +161,15 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data)
case '+':
voice = TRUE;
break;
+ default:
+ /* If this flag is listed higher than op (in the
+ * isupport PREFIX reply), then count this user
+ * as an op. */
+ nick_flag_cur = strchr(nick_flags, *ptr);
+ if (nick_flag_cur && nick_flag_op && nick_flag_cur < nick_flag_op) {
+ op = TRUE;
+ }
+ break;
}
ptr++;
}