add user and real name config options
This commit is contained in:
parent
015c20e061
commit
0661b29519
@ -31,7 +31,8 @@ struct irc_conn
|
|||||||
FILE *srv_fd;
|
FILE *srv_fd;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char nick[32];
|
char nick[50];
|
||||||
|
char user[50];
|
||||||
char admin[256];
|
char admin[256];
|
||||||
char host[256];
|
char host[256];
|
||||||
char port[5];
|
char port[5];
|
||||||
|
@ -33,6 +33,12 @@ struct irc_conn read_config(struct irc_conn bot, char *file)
|
|||||||
if (config_lookup_string(cf, "bot.nick", &base))
|
if (config_lookup_string(cf, "bot.nick", &base))
|
||||||
strlcpy(bot.nick, base, sizeof bot.nick);
|
strlcpy(bot.nick, base, sizeof bot.nick);
|
||||||
|
|
||||||
|
if (config_lookup_string(cf, "bot.user", &base))
|
||||||
|
strlcpy(bot.user, base, sizeof bot.user);
|
||||||
|
|
||||||
|
if (config_lookup_string(cf, "bot.real", &base))
|
||||||
|
strlcpy(bot.real_name, base, sizeof bot.real_name);
|
||||||
|
|
||||||
if (config_lookup_string(cf, "server.host", &base))
|
if (config_lookup_string(cf, "server.host", &base))
|
||||||
strlcpy(bot.host, base, sizeof bot.host);
|
strlcpy(bot.host, base, sizeof bot.host);
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ void irc_connect(struct irc_conn *bot)
|
|||||||
void irc_auth(struct irc_conn *bot)
|
void irc_auth(struct irc_conn *bot)
|
||||||
{
|
{
|
||||||
irc_raw(bot, "NICK %s", bot->nick);
|
irc_raw(bot, "NICK %s", bot->nick);
|
||||||
irc_raw(bot, "USER %s \" %s :xbot v%s (https://github.com/ablakely/xbot)", bot->nick, bot->host, VERSION);
|
irc_raw(bot, "USER %s \" %s :%s", bot->user, bot->host, bot->real_name);
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
fflush(bot->srv_fd);
|
fflush(bot->srv_fd);
|
||||||
@ -291,9 +291,9 @@ void irc_parse_raw(struct irc_conn *bot, char *raw)
|
|||||||
if (!strcmp("VERSION", ctcp))
|
if (!strcmp("VERSION", ctcp))
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
irc_notice(bot, user, "VERSION xbot: v%s (Windows)", VERSION);
|
irc_notice(bot, user, "VERSION xbot: v%s [Windows] (https://github.com/ablakely/xbot)", VERSION);
|
||||||
#else
|
#else
|
||||||
irc_notice(bot, user, "VERSION xbot: v%s (Linux)", VERSION);
|
irc_notice(bot, user, "VERSION xbot: v%s [Linux] (https://github.com/ablakely/xbot)", VERSION);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user