This commit is contained in:
Emil 2023-08-04 05:57:20 -06:00
parent 5f77a905fa
commit ca4ef988e8
3 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,3 @@
server=irc.rizon.net server=irc.rizon.net
username=probotic username=probotic
port=6667 port=6667
;admins=anon8697 emilemilemil fa11_1eaf
; these arent comments, but they work because
; the parser is broken enough to make it just werk

View File

@ -99,7 +99,7 @@ event_connect(irc_session_t * session,
/* msg ChanServ IDENTIFY? */ /* msg ChanServ IDENTIFY? */
irc_cmd_join(session, creds.channel, 0); irc_cmd_join(session, creds.channel, 0);
if(is_no_assignment(creds.channel)){ if(is_no_assignment(creds.channel)){
ircmsg(IRC_RED "No assignment for this channel. Finding a new..."); ircmsg(IRC_RED "No assignment for this channel. Finding a new..." IRC_STOP);
random_assign(creds.channel); random_assign(creds.channel);
} }
ircmsg(remind(creds.channel)); ircmsg(remind(creds.channel));

View File

@ -22,6 +22,7 @@
enum cred_names_map enum cred_names_map
{ {
DATABASE,
USERNAME, USERNAME,
PASSWORD, PASSWORD,
CHANNEL, CHANNEL,
@ -32,6 +33,7 @@ enum cred_names_map
VARDECL char const * cred_names[] = VARDECL char const * cred_names[] =
{ {
"database",
"username", "username",
"password", "password",
"channel", "channel",
@ -44,6 +46,7 @@ VARDECL size_t const cred_names_len[] =
{ {
8, 8,
8, 8,
8,
7, 7,
6, 6,
4, 4,
@ -238,6 +241,7 @@ parse_pair(char const * buf, size_t len)
} }
switch (f) switch (f)
{ {
case DATABASE: db = strndup(buf,x); break;
case USERNAME: creds.username = strndup(buf,x); break; case USERNAME: creds.username = strndup(buf,x); break;
case PASSWORD: creds.password = strndup(buf,x); break; case PASSWORD: creds.password = strndup(buf,x); break;
case CHANNEL: creds.channel = strndup(buf,x); break; case CHANNEL: creds.channel = strndup(buf,x); break;