From a25a912ec85792e92123be19be0d47098b0dc8b6 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 10 Aug 2000 19:39:06 +0000 Subject: [PATCH] /channel add -bots: You can now use @ or + before the nick mask to indicate that bot should have either ops or voices/ops. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@578 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/channels-setup.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/irc/core/channels-setup.c b/src/irc/core/channels-setup.c index 4f3cf17b..1252854a 100644 --- a/src/irc/core/channels-setup.c +++ b/src/irc/core/channels-setup.c @@ -21,6 +21,7 @@ #include "module.h" #include "signals.h" +#include "irc.h" #include "channels.h" #include "channels-setup.h" #include "nicklist.h" @@ -164,9 +165,15 @@ static void channel_wholist(CHANNEL_REC *channel) /* find first available bot.. */ bots = g_strsplit(rec->botmasks, " ", -1); for (bot = bots; *bot != NULL; bot++) { - nick = nicklist_find(channel, *bot); + const char *botnick = *bot; + + nick = nicklist_find(channel, isnickflag(*botnick) ? + botnick+1 : botnick); if (nick == NULL) continue; + if ((*botnick == '@' && !nick->op) || + (*botnick == '+' && !nick->voice && !nick->op)) + continue; /* got one! */ eval_special_string(rec->autosendcmd, nick->nick, channel->server, channel);