git-svn-id: file:///raid/svn-personal/okuu/trunk@4 7d206d2a-66c2-044b-96de-ba755a9b3ba8
This commit is contained in:
Nishi 2024-09-10 19:26:12 +00:00
parent 48de4cf52e
commit abb3245bd5
2 changed files with 7 additions and 10 deletions

View File

@ -111,6 +111,7 @@ void ok_bot(void){
ircfw_socket_send_cmd(ok_sock, NULL, construct);
bool is_in = false;
bool sendable = false;
struct pollfd pollfds[1];
pollfds[0].fd = ok_sock;
@ -131,6 +132,10 @@ void ok_bot(void){
if(n >= 0){
int i;
for(i = 0; i < n; i++){
if(!sendable){
free(list[i]);
continue;
}
if(count <= atoi(list[i]->d_name)){
sprintf(construct, "%s/%s", nntppath, list[i]->d_name);
if(ok_news_read(construct) == 0){
@ -192,6 +197,8 @@ void ok_bot(void){
fprintf(stderr, "Login successful\n");
sprintf(construct, "JOIN :%s", ircchan);
ircfw_socket_send_cmd(ok_sock, NULL, construct);
}else if(res == 331 || res == 332){
sendable = true;
}
}else{
if(strcasecmp(ircfw_message.command, "PING") == 0){

View File

@ -1,10 +0,0 @@
#!/bin/sh
export NNTPSERVER=127.0.0.1
export NNTPPATH=/var/news/spool/articles/comp/os/netbsd
export NNTPCOUNT=netbsd-count
export IRCSERVER=192.168.0.161
export IRCCHAN=#test
export IRCUSER=okuu
export IRCNICK=Okuu
export IRCREAL="Utsuho Reiuji"
./Bot/okuu