tried to reorder the program structure and build process
[NeonServV5.git] / cmd_neonserv_events.c
diff --git a/cmd_neonserv_events.c b/cmd_neonserv_events.c
deleted file mode 100644 (file)
index 23ecf3c..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-
-#include "cmd_neonserv.h"
-
-/*
-* argv[0]     time
-* argv[1-*]   match
-*/
-
-CMD_BIND(neonserv_cmd_events) {
-    char *str_match;
-    int duration = (argc ? strToTime(user, argv[0]) : 0);
-    if(argc > (duration ? 1 : 0))
-        str_match = merge_argv(argv, (duration ? 1 : 0), argc);
-    else
-        str_match = "";
-    if(!duration) duration = (60*60*24);
-    MYSQL_RES *res;
-    MYSQL_ROW row;
-    printf_mysql_query("SELECT `time`, `auth`, `nick`, `command` FROM `events` WHERE `cid` = '%d' AND `time` > '%lu' ORDER BY `time` ASC", chan->channel_id, ((unsigned long) time(0) - duration));
-    res = mysql_use();
-    int skip = mysql_num_rows(res) - 100;
-    int count = 0;
-    char timeBuf[50];
-    struct tm *timeinfo;
-    time_t event_time;
-    if(skip < 0) skip = 0;
-    reply(getTextBot(), user, "NS_EVENTS_HEADER");
-    while ((row = mysql_fetch_row(res)) != NULL) {
-        if(skip) {
-            skip--;
-            continue;
-        }
-        if(*str_match && match(str_match, row[3])) continue;
-        count++;
-        event_time = (time_t) atol(row[0]);
-        timeinfo = localtime(&event_time);
-        strftime(timeBuf, 80, "%X %x", timeinfo);
-        reply(getTextBot(), user, "[%s] [%s:%s]: %s", timeBuf, row[2], row[1], row[3]);
-    }
-    reply(getTextBot(), user, "NS_TABLE_COUNT", count);
-}