Link Here
|
399 |
for (tmp = nicklist; tmp != NULL; tmp = tmp->next) { |
399 |
for (tmp = nicklist; tmp != NULL; tmp = tmp->next) { |
400 |
NICK_REC *rec = tmp->data; |
400 |
NICK_REC *rec = tmp->data; |
401 |
|
401 |
|
402 |
if (rec->op) |
402 |
if (rec->admin) |
|
|
403 |
nickmode[0] = '!'; |
404 |
else if (rec->op) |
403 |
nickmode[0] = '@'; |
405 |
nickmode[0] = '@'; |
404 |
else if (rec->halfop) |
406 |
else if (rec->halfop) |
405 |
nickmode[0] = '%'; |
407 |
nickmode[0] = '%'; |
Link Here
|
416 |
linebuf[columns[col]-item_extra] = '\0'; |
418 |
linebuf[columns[col]-item_extra] = '\0'; |
417 |
memcpy(linebuf, rec->nick, strlen(rec->nick)); |
419 |
memcpy(linebuf, rec->nick, strlen(rec->nick)); |
418 |
|
420 |
|
419 |
formatnum = rec->op ? TXT_NAMES_NICK_OP : |
421 |
formatnum = rec->admin ? TXT_NAMES_NICK_ADMIN : |
|
|
422 |
rec->op ? TXT_NAMES_NICK_OP : |
420 |
rec->halfop ? TXT_NAMES_NICK_HALFOP : |
423 |
rec->halfop ? TXT_NAMES_NICK_HALFOP : |
421 |
rec->voice ? TXT_NAMES_NICK_VOICE : |
424 |
rec->voice ? TXT_NAMES_NICK_VOICE : |
422 |
TXT_NAMES_NICK; |
425 |
TXT_NAMES_NICK; |
Link Here
|
456 |
{ |
459 |
{ |
457 |
NICK_REC *nick; |
460 |
NICK_REC *nick; |
458 |
GSList *tmp, *nicklist, *sorted; |
461 |
GSList *tmp, *nicklist, *sorted; |
459 |
int nicks, normal, voices, halfops, ops; |
462 |
int nicks, normal, voices, halfops, ops, admins; |
460 |
|
463 |
|
461 |
nicks = normal = voices = halfops = ops = 0; |
464 |
admins = nicks = normal = voices = halfops = ops = 0; |
462 |
nicklist = nicklist_getnicks(channel); |
465 |
nicklist = nicklist_getnicks(channel); |
463 |
sorted = NULL; |
466 |
sorted = NULL; |
464 |
|
467 |
|
Link Here
|
467 |
nick = tmp->data; |
470 |
nick = tmp->data; |
468 |
|
471 |
|
469 |
nicks++; |
472 |
nicks++; |
470 |
if (nick->op) { |
473 |
if (nick->admin) { |
|
|
474 |
admins++; |
475 |
if ((flags & CHANNEL_NICKLIST_FLAG_ADMINS) == 0) |
476 |
continue; |
477 |
} else if (nick->op) { |
471 |
ops++; |
478 |
ops++; |
472 |
if ((flags & CHANNEL_NICKLIST_FLAG_OPS) == 0) |
479 |
if ((flags & CHANNEL_NICKLIST_FLAG_OPS) == 0) |
473 |
continue; |
480 |
continue; |
Link Here
|
495 |
printformat(channel->server, channel->visible_name, |
502 |
printformat(channel->server, channel->visible_name, |
496 |
MSGLEVEL_CLIENTCRAP, TXT_NAMES, |
503 |
MSGLEVEL_CLIENTCRAP, TXT_NAMES, |
497 |
channel->visible_name, |
504 |
channel->visible_name, |
498 |
nicks, ops, halfops, voices, normal); |
505 |
nicks, admins, ops, halfops, voices, normal); |
499 |
display_sorted_nicks(channel, sorted); |
506 |
display_sorted_nicks(channel, sorted); |
500 |
} |
507 |
} |
501 |
g_slist_free(sorted); |
508 |
g_slist_free(sorted); |
502 |
|
509 |
|
503 |
printformat(channel->server, channel->visible_name, |
510 |
printformat(channel->server, channel->visible_name, |
504 |
MSGLEVEL_CLIENTNOTICE, TXT_ENDOFNAMES, |
511 |
MSGLEVEL_CLIENTNOTICE, TXT_ENDOFNAMES, |
505 |
channel->visible_name, nicks, ops, halfops, voices, normal); |
512 |
channel->visible_name, nicks, admins, ops, halfops, voices, normal); |
506 |
} |
513 |
} |
507 |
|
514 |
|
508 |
/* SYNTAX: NAMES [-count | -ops -halfops -voices -normal] [<channels> | **] */ |
515 |
/* SYNTAX: NAMES [-count | -admins -ops -halfops -voices -normal] [<channels> | **] */ |
509 |
static void cmd_names(const char *data, SERVER_REC *server, WI_ITEM_REC *item) |
516 |
static void cmd_names(const char *data, SERVER_REC *server, WI_ITEM_REC *item) |
510 |
{ |
517 |
{ |
511 |
CHANNEL_REC *chanrec; |
518 |
CHANNEL_REC *chanrec; |
Link Here
|
531 |
} |
538 |
} |
532 |
|
539 |
|
533 |
flags = 0; |
540 |
flags = 0; |
|
|
541 |
if (g_hash_table_lookup(optlist, "admin") != NULL) |
542 |
flags |= CHANNEL_NICKLIST_FLAG_ADMINS; |
534 |
if (g_hash_table_lookup(optlist, "ops") != NULL) |
543 |
if (g_hash_table_lookup(optlist, "ops") != NULL) |
535 |
flags |= CHANNEL_NICKLIST_FLAG_OPS; |
544 |
flags |= CHANNEL_NICKLIST_FLAG_OPS; |
536 |
if (g_hash_table_lookup(optlist, "halfops") != NULL) |
545 |
if (g_hash_table_lookup(optlist, "halfops") != NULL) |
Link Here
|
629 |
command_bind("cycle", NULL, (SIGNAL_FUNC) cmd_cycle); |
638 |
command_bind("cycle", NULL, (SIGNAL_FUNC) cmd_cycle); |
630 |
|
639 |
|
631 |
command_set_options("channel add", "auto noauto -bots -botcmd"); |
640 |
command_set_options("channel add", "auto noauto -bots -botcmd"); |
632 |
command_set_options("names", "count ops halfops voices normal"); |
641 |
command_set_options("names", "count admins ops halfops voices normal"); |
633 |
command_set_options("join", "window"); |
642 |
command_set_options("join", "window"); |
634 |
} |
643 |
} |
635 |
|
644 |
|