mirror of
https://github.com/irssi/irssi.git
synced 2026-08-19 08:32:07 +02:00
/LIST: don't require -yes option if there's 1000 channels or less.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1057 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
131825ea0e
commit
69f3b3f159
4 changed files with 28 additions and 11 deletions
|
|
@ -40,6 +40,10 @@
|
|||
/* How often to check if there's anyone to be unbanned in knockout list */
|
||||
#define KNOCKOUT_TIMECHECK 10000
|
||||
|
||||
/* /LIST: Max. number of channels in IRC network before -yes option
|
||||
is required */
|
||||
#define LIST_MAX_CHANNELS_PASS 1000
|
||||
|
||||
typedef struct {
|
||||
IRC_CHANNEL_REC *channel;
|
||||
char *ban;
|
||||
|
|
@ -363,7 +367,8 @@ static void cmd_invite(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *it
|
|||
}
|
||||
|
||||
/* SYNTAX: LIST [-yes] [<channel>] */
|
||||
static void cmd_list(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
|
||||
static void cmd_list(const char *data, IRC_SERVER_REC *server,
|
||||
WI_ITEM_REC *item)
|
||||
{
|
||||
GHashTable *optlist;
|
||||
char *str;
|
||||
|
|
@ -377,7 +382,9 @@ static void cmd_list(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item
|
|||
PARAM_FLAG_GETREST, "list", &optlist, &str))
|
||||
return;
|
||||
|
||||
if (*str == '\0' && g_hash_table_lookup(optlist, "yes") == NULL)
|
||||
if (*str == '\0' && g_hash_table_lookup(optlist, "yes") == NULL &&
|
||||
(server->channels_formed <= 0 ||
|
||||
server->channels_formed > LIST_MAX_CHANNELS_PASS))
|
||||
cmd_param_error(CMDERR_NOT_GOOD_IDEA);
|
||||
|
||||
irc_send_cmdv(server, "LIST %s", str);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue