From 812c58d2c1f89bb12dab423ffc8ded804ad09273 Mon Sep 17 00:00:00 2001 From: Nishi Date: Wed, 11 Sep 2024 00:40:20 +0000 Subject: [PATCH] fix stuff git-svn-id: file:///raid/svn-personal/okuu/trunk@7 7d206d2a-66c2-044b-96de-ba755a9b3ba8 --- Bot/bot.c | 11 +++++++---- Bot/news.c | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Bot/bot.c b/Bot/bot.c index 550bc0e..7f76356 100644 --- a/Bot/bot.c +++ b/Bot/bot.c @@ -159,6 +159,7 @@ void ok_bot(void){ char* msg = ok_strcat(temp, line); ircfw_socket_send_cmd(ok_sock, NULL, msg); free(msg); + usleep(1000 * 100); /* Sleep for 100ms */ } free(line); @@ -176,10 +177,12 @@ void ok_bot(void){ count = atoi(list[i - 1]->d_name) + 1; free(list); } - f = fopen(nntpcount, "wb"); - if(f != NULL){ - fwrite(&count, sizeof(count), 1, f); - fclose(f); + if(sendable){ + f = fopen(nntpcount, "wb"); + if(f != NULL){ + fwrite(&count, sizeof(count), 1, f); + fclose(f); + } } continue; } diff --git a/Bot/news.c b/Bot/news.c index cdc3d26..fcfdfb1 100644 --- a/Bot/news.c +++ b/Bot/news.c @@ -286,6 +286,7 @@ int ok_news_write(const char* nick, const char* message){ if(nntppass != NULL){ sprintf(construct, "AUTHINFO PASS %s\r\n", nntppass); send(nt_sock, construct, strlen(construct), 0); + sta = ok_news_parse(nt_sock); if(sta != 281){ goto cleanup; } @@ -300,7 +301,7 @@ int ok_news_write(const char* nick, const char* message){ send(nt_sock, construct, strlen(construct), 0); sprintf(construct, "Newsgroups: %s\r\n", nntpgroup); send(nt_sock, construct, strlen(construct), 0); - sprintf(construct, "Subject: Message from %s\r\n", nick); + sprintf(construct, "Subject: [IRC] Message from %s\r\n", nick); send(nt_sock, construct, strlen(construct), 0); send(nt_sock, "\r\n", 2, 0); char c; -- 2.43.0