X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Fcmd_neonserv_peek.c;h=51de508c12d535381a2d271bc359bd3f1e378bed;hp=67244037f9ca045a071b491d3abcb6dbb1a718f8;hb=b013fcf166b6b84f7b946412dacfe84ba5cfe6b6;hpb=0f1dc61921eef1db8e404a5a82372e2d1cd55daa diff --git a/src/cmd_neonserv_peek.c b/src/cmd_neonserv_peek.c index 6724403..51de508 100644 --- a/src/cmd_neonserv_peek.c +++ b/src/cmd_neonserv_peek.c @@ -1,3 +1,19 @@ +/* cmd_neonserv_peek.c - NeonServ v5.3 + * Copyright (C) 2011-2012 Philipp Kreil (pk910) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "cmd_neonserv.h" @@ -21,7 +37,7 @@ CMD_BIND(neonserv_cmd_peek) { cache->client = client; cache->textclient = getTextBot(); cache->user = user; - get_userlist_with_invisible(chan, neonserv_cmd_peek_userlist_lookup, cache); + get_userlist_if_invisible(chan, neonserv_cmd_peek_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_peek_userlist_lookup) { @@ -37,18 +53,24 @@ static void neonserv_cmd_peek_async1(struct ClientSocket *client, struct ClientS getModeString(chan->modes, tmpStr); reply(textclient, user, "NS_PEEK_MODES", tmpStr); struct ChanUser *chanuser; - int op_count = 0, voice_count = 0, normal_count = 0, invi_count = 0; + int with_halfops = get_int_field("General.have_halfop"); + int op_count = 0, halfop_count = 0, voice_count = 0, normal_count = 0, invi_count = 0; for(chanuser = getChannelUsers(chan, NULL); chanuser; chanuser = getChannelUsers(chan, chanuser)) { if(chanuser->flags & CHANUSERFLAG_OPPED) op_count++; + else if(with_halfops && (chanuser->flags & CHANUSERFLAG_HALFOPPED)) + halfop_count++; else if(chanuser->flags & CHANUSERFLAG_VOICED) voice_count++; - else if(chanuser->flags & CHANUSERFLAG_VOICED) + else if(chanuser->flags & CHANUSERFLAG_INVISIBLE) invi_count++; else normal_count++; } - reply(textclient, user, "NS_PEEK_USERS", op_count+voice_count+invi_count+normal_count, op_count, voice_count, normal_count, invi_count); + if(with_halfops) + reply(textclient, user, "NS_PEEK_USERS_HALFOP", op_count+halfop_count+voice_count+invi_count+normal_count, op_count, halfop_count, voice_count, normal_count, invi_count); + else + reply(textclient, user, "NS_PEEK_USERS", op_count+voice_count+invi_count+normal_count, op_count, voice_count, normal_count, invi_count); int tmpStrPos = 0; int headerlen = 10 + strlen(user->nick); for(chanuser = getChannelUsers(chan, NULL); chanuser; chanuser = getChannelUsers(chan, chanuser)) {