hostserv help fixups and tidy ups
This commit is contained in:
parent
309c36b989
commit
09927e96e1
2 changed files with 50 additions and 54 deletions
|
@ -52,7 +52,7 @@ struct hs_cfg {
|
|||
} hs_cfg;
|
||||
|
||||
static int hs_event_signon (CmdParams *cmdparams);
|
||||
static int hs_event_mode (CmdParams *cmdparams);
|
||||
static int hs_event_umode (CmdParams *cmdparams);
|
||||
|
||||
static int hs_cmd_bans (CmdParams *cmdparams);
|
||||
static int hs_cmd_login (CmdParams *cmdparams);
|
||||
|
@ -61,9 +61,6 @@ static int hs_cmd_add (CmdParams *cmdparams);
|
|||
static int hs_cmd_list (CmdParams *cmdparams);
|
||||
static int hs_cmd_view (CmdParams *cmdparams);
|
||||
static int hs_cmd_del (CmdParams *cmdparams);
|
||||
static int hs_cmd_bans_list (CmdParams *cmdparams);
|
||||
static int hs_cmd_bans_add (CmdParams *cmdparams);
|
||||
static int hs_cmd_bans_del (CmdParams *cmdparams);
|
||||
|
||||
static int hs_set_regnick_cb (CmdParams* cmdparams, SET_REASON reason);
|
||||
static int hs_set_expire_cb (CmdParams* cmdparams, SET_REASON reason);
|
||||
|
@ -135,7 +132,7 @@ static BotInfo hs_botinfo =
|
|||
/** Module Events */
|
||||
ModuleEvent module_events[] = {
|
||||
{EVENT_SIGNON, hs_event_signon, EVENT_FLAG_EXCLUDE_ME | EVENT_FLAG_USE_EXCLUDE},
|
||||
{EVENT_UMODE, hs_event_mode, EVENT_FLAG_EXCLUDE_ME | EVENT_FLAG_USE_EXCLUDE},
|
||||
{EVENT_UMODE, hs_event_umode, EVENT_FLAG_EXCLUDE_ME | EVENT_FLAG_USE_EXCLUDE},
|
||||
{EVENT_NULL, NULL}
|
||||
};
|
||||
|
||||
|
@ -389,7 +386,7 @@ static int hs_event_signon (CmdParams *cmdparams)
|
|||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/** @brief hs_event_mode
|
||||
/** @brief hs_event_umode
|
||||
*
|
||||
* Event handler for umode to set a user's host on regnick
|
||||
*
|
||||
|
@ -398,7 +395,7 @@ static int hs_event_signon (CmdParams *cmdparams)
|
|||
* @return NS_SUCCESS if succeeds, else NS_FAILURE
|
||||
*/
|
||||
|
||||
static int hs_event_mode (CmdParams *cmdparams)
|
||||
static int hs_event_umode (CmdParams *cmdparams)
|
||||
{
|
||||
int add = 0;
|
||||
char *modes;
|
||||
|
@ -406,7 +403,6 @@ static int hs_event_mode (CmdParams *cmdparams)
|
|||
|
||||
if (is_oper(cmdparams->source) && hs_cfg.operhosts == 0)
|
||||
return NS_SUCCESS;
|
||||
|
||||
/* first, find if its a regnick mode */
|
||||
modes = cmdparams->av[1];
|
||||
while (*modes) {
|
||||
|
@ -531,33 +527,6 @@ static void new_vhost (char *nick, char *host, char *vhost, char *pass, char *wh
|
|||
SaveVhost (vhe);
|
||||
}
|
||||
|
||||
/** @brief hs_cmd_bans
|
||||
*
|
||||
* Command handler for BANS
|
||||
*
|
||||
* @param cmdparams
|
||||
*
|
||||
* @return NS_SUCCESS if succeeds, else NS_FAILURE
|
||||
*/
|
||||
|
||||
static int hs_cmd_bans (CmdParams *cmdparams)
|
||||
{
|
||||
if (!ircstrcasecmp (cmdparams->av[0], "LIST")) {
|
||||
return hs_cmd_bans_list (cmdparams);
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "ADD")) {
|
||||
if (cmdparams->ac < 3) {
|
||||
return NS_ERR_NEED_MORE_PARAMS;
|
||||
}
|
||||
return hs_cmd_bans_add (cmdparams);
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "DEL")) {
|
||||
if (cmdparams->ac < 2) {
|
||||
return NS_ERR_NEED_MORE_PARAMS;
|
||||
}
|
||||
return hs_cmd_bans_del (cmdparams);
|
||||
}
|
||||
return NS_ERR_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
/** @brief hs_cmd_bans_list
|
||||
*
|
||||
* Command handler for BANS LIST
|
||||
|
@ -660,6 +629,33 @@ static int hs_cmd_bans_del (CmdParams *cmdparams)
|
|||
return NS_SUCCESS;
|
||||
}
|
||||
|
||||
/** @brief hs_cmd_bans
|
||||
*
|
||||
* Command handler for BANS
|
||||
*
|
||||
* @param cmdparams
|
||||
*
|
||||
* @return NS_SUCCESS if succeeds, else NS_FAILURE
|
||||
*/
|
||||
|
||||
static int hs_cmd_bans (CmdParams *cmdparams)
|
||||
{
|
||||
if (!ircstrcasecmp (cmdparams->av[0], "LIST")) {
|
||||
return hs_cmd_bans_list (cmdparams);
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "ADD")) {
|
||||
if (cmdparams->ac < 3) {
|
||||
return NS_ERR_NEED_MORE_PARAMS;
|
||||
}
|
||||
return hs_cmd_bans_add (cmdparams);
|
||||
} else if (!ircstrcasecmp (cmdparams->av[0], "DEL")) {
|
||||
if (cmdparams->ac < 2) {
|
||||
return NS_ERR_NEED_MORE_PARAMS;
|
||||
}
|
||||
return hs_cmd_bans_del (cmdparams);
|
||||
}
|
||||
return NS_ERR_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
/** @brief hs_cmd_chpass
|
||||
*
|
||||
* Command handler for CHPASS
|
||||
|
|
|
@ -34,28 +34,25 @@ const char hs_help_list_oneline[] ="List vhosts";
|
|||
const char hs_help_view_oneline[] ="Detailed vhost list";
|
||||
|
||||
const char *hs_about[] = {
|
||||
"\2HostServ\2 allows users to use their own unique host",
|
||||
"while on the Network. IRC Operators add them to the",
|
||||
"database and upon connection the user gets their vhost.",
|
||||
"\2HostServ\2 allows users to have a unique virtual host",
|
||||
"while on the network. Virtual hosts are set automatically",
|
||||
"when you join the network or by using the LOGIN command",
|
||||
"",
|
||||
"If you find your host is not working, it could have been",
|
||||
"removed due to abuse, or the fact you are connecting from",
|
||||
"a different ISP or have a numerical address.",
|
||||
"Contact an admin.",
|
||||
"If you find your host is not working, it may have been",
|
||||
"removed due to abuse and you should contact an operator.",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *hs_help_add[] = {
|
||||
"Syntax: \2ADD <NICK> <HOSTNAME> <VHOST> <PASSWORD>\2",
|
||||
"",
|
||||
"Register a vhost with hostserv. e.g. my-host.com.",
|
||||
"HOSTNAME must be where the user is connecting from",
|
||||
"\2without the @\2",
|
||||
"HOSTNAME can include wildcards e.g. *.myhost.com",
|
||||
"Users can also get their vhost by typing the command:",
|
||||
" \2/msg HostServ LOGIN nick password\2",
|
||||
"This allows them to use the vhost from any host and for",
|
||||
"multiple users to share one vhost",
|
||||
"Register a vhost with hostserv. e.g. vhost.com.",
|
||||
"HOSTNAME is the host the user is connecting from",
|
||||
"such as realhost.com and can include wildcards",
|
||||
"such as *.realhost.com.",
|
||||
"Users can also get their vhost with the LOGIN",
|
||||
"command. This allows them use of the vhost from"
|
||||
"multiple hosts or multiple users to share a vhost.",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -80,15 +77,18 @@ const char *hs_help_list[] = {
|
|||
"Lists the current vhosts stored in the database.",
|
||||
"For more descriptive info on a vhost see \2HELP VIEW\2",
|
||||
"",
|
||||
"Optional startpos will start listing from that position",
|
||||
"A maximum 20 vhosts are displayed at one time, in order",
|
||||
"to view other vhosts, the <startpos> parameter allows",
|
||||
"listing from that position",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *hs_help_login[] = {
|
||||
"Syntax: \2LOGIN <NICK> <PASSWORD>\2",
|
||||
"",
|
||||
"Sets your vhost if it was not set when you connect to IRC",
|
||||
"or you are connecting from a different host.",
|
||||
"Sets your vhost if it was not set when you connect to IRC,",
|
||||
"or you are connecting from a different host, or you share a.",
|
||||
"vhost with other users.",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -101,7 +101,7 @@ const char *hs_help_chpass[] = {
|
|||
|
||||
const char *hs_help_bans[] = {
|
||||
"Syntax: \2BANS LIST\2",
|
||||
" \2BANS ADD <hostname>\2",
|
||||
" \2BANS ADD <hostname> <reason>\2",
|
||||
" \2BANS DEL <hostname>\2",
|
||||
"",
|
||||
"Maintain the list of banned vhosts.",
|
||||
|
|
Reference in a new issue