]> Nishi Git Mirror - okuu.git/commitdiff
fix stuff
authorNishi <nishi@nishi.boats>
Wed, 11 Sep 2024 00:40:20 +0000 (00:40 +0000)
committerNishi <nishi@nishi.boats>
Wed, 11 Sep 2024 00:40:20 +0000 (00:40 +0000)
git-svn-id: file:///raid/svn-personal/okuu/trunk@7 7d206d2a-66c2-044b-96de-ba755a9b3ba8

Bot/bot.c
Bot/news.c

index 550bc0e8a290ee99a62ecabb568e3c06fb572a65..7f76356a4cdcb715e9700f480f559c3e2fa2fe0b 100644 (file)
--- 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;
                }
index cdc3d269c75d73fa4f63e2dffd12360ea331e977..fcfdfb1cba2e0b35ae655dda348a326b2991f744 100644 (file)
@@ -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;