| curmode <= 4095 | 621 | | if (*curmode == '\0') | | | 622 | | break; | | | 623 | | } | | | 624 | | | | | 625 | | if (*curmode == '+' || *curmode == '-') { | | | 626 | | type = *curmode; | | | 627 | | continue; | | | 628 | | } | | | 629 | | | | | 630 | | if (count == server->max_modes_in_cmd && | | | 631 | | HAS_MODE_ARG(server, type, *curmode)) {
| | | 632 | | irc_send_cmdv(server, "MODE %s %s%s", | | | 633 | | channel, tmode->str, targs->str); | | | 634 | | | | | 635 | | count = 0; prevtype = '\0'; | | | 636 | | g_string_truncate(tmode, 0); | | | 637 | | g_string_truncate(targs, 0); | | | 638 | | } | | | 639 | | | | | 640 | | if (type != prevtype) { | | | 641 | | prevtype = type; | | | 642 | | g_string_append_c(tmode, type);
| | | 643 | | } | | | 644 | | g_string_append_c(tmode, *curmode);
| | | 645 | | | | | 646 | | if (HAS_MODE_ARG(server, type, *curmode)) {
| | | 647 | | char *arg; | | | 648 | | | | | 649 | | count++; | | | 650 | | arg = cmd_get_param(&modestr); | | | 651 | | if (*arg == '\0' && type == '-' && *curmode == 'k') { | | | 652 | | | | | 653 | | | | | 654 | | IRC_CHANNEL_REC *chanrec; | | | 655 | | | | | 656 | | chanrec = irc_channel_find(server, channel);
| | | 657 | | if (chanrec != NULL && chanrec->key != NULL)
| | | 658 | | arg = chanrec->key; | | | 659 | | } | | | 660 | | | | | 661 | | if (*arg != '\0') | | | 662 | | g_string_append_printf(targs, " %s", arg); |
|