Subversion Repositories IRC-Archiver

Rev

Rev 17 | Rev 19 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17 Rev 18
Line 1... Line 1...
1
/* $Id: bot.c 17 2024-08-30 08:22:50Z nishi $ */
1
/* $Id: bot.c 18 2024-08-30 08:29:19Z nishi $ */
2
 
2
 
3
#include "ia_bot.h"
3
#include "ia_bot.h"
4
 
4
 
5
#include "ia_util.h"
5
#include "ia_util.h"
6
#include "ia_db.h"
6
#include "ia_db.h"
Line 220... Line 220...
220
										}
220
										}
221
										if(oldc == 0) {
221
										if(oldc == 0) {
222
											if(chn == NULL) {
222
											if(chn == NULL) {
223
												sprintf(construct, "PRIVMSG %s :Insufficient arguments", nick);
223
												sprintf(construct, "PRIVMSG %s :Insufficient arguments", nick);
224
												ircfw_socket_send_cmd(ia_sock, NULL, construct);
224
												ircfw_socket_send_cmd(ia_sock, NULL, construct);
-
 
225
											} else if(strcmp(name, "index") == 0) {
-
 
226
												sprintf(construct, "PRIVMSG %s :You cannot use that name", nick);
-
 
227
												ircfw_socket_send_cmd(ia_sock, NULL, construct);
225
											} else {
228
											} else {
226
												web_range_t range;
229
												web_range_t range;
227
												struct tm from_tm;
230
												struct tm from_tm;
228
												memset(&from_tm, 0, sizeof(from_tm));
231
												memset(&from_tm, 0, sizeof(from_tm));
229
												struct tm to_tm;
232
												struct tm to_tm;
Line 244... Line 247...
244
														ircfw_socket_send_cmd(ia_sock, NULL, construct);
247
														ircfw_socket_send_cmd(ia_sock, NULL, construct);
245
														break;
248
														break;
246
													}
249
													}
247
													tto = mktime(&to_tm);
250
													tto = mktime(&to_tm);
248
												}
251
												}
-
 
252
 
-
 
253
												char* hpath = ia_strcat4(webroot, "/", name, ".html");
-
 
254
												struct stat s;
-
 
255
												if(stat(hpath, &s) == 0) {
-
 
256
													sprintf(construct, "PRIVMSG %s :Archive which has the same name already exists", nick);
-
 
257
													ircfw_socket_send_cmd(ia_sock, NULL, construct);
-
 
258
													break;
-
 
259
												}
-
 
260
 
249
												int j;
261
												int j;
250
												bool found = false;
262
												bool found = false;
251
												for(j = 0; channels[j] != NULL; j++) {
263
												for(j = 0; channels[j] != NULL; j++) {
252
													if(strcmp(channels[j], chn) == 0) {
264
													if(strcmp(channels[j], chn) == 0) {
253
														found = true;
265
														found = true;