fixed HandleInfoHandler
authorpk910 <philipp@zoelle1.de>
Thu, 6 Oct 2011 16:42:49 +0000 (18:42 +0200)
committerpk910 <philipp@zoelle1.de>
Mon, 17 Oct 2011 14:06:46 +0000 (16:06 +0200)
src/HandleInfoHandler.c
src/cmd_neonserv_unvisited.c

index c03abcee713ca6f499ea357478a28684172b4c25..80f98a3a022fcf6d41640d7d28059941b8be4902 100644 (file)
@@ -115,9 +115,11 @@ static void recv_notice(struct UserNode *user, struct UserNode *target, char *me
     }
     if(do_match) {
         struct HandleInfoQueueEntry* entry = getNextHandleInfoQueueEntry(bot, 1);
-        authlookup_callback_t *callback = entry->callback;
-        callback(auth, exists, entry->data);
-        free(entry);
+        if(entry) {
+            authlookup_callback_t *callback = entry->callback;
+            callback(auth, exists, entry->data);
+            free(entry);
+        }
     }
 }
 
index 3cfaed98bfd97ba0d96c6d6c9b6e4070eac37dcc..14ecce80e1f0552258a9a997fde40be1b89c248f 100644 (file)
@@ -52,7 +52,7 @@ CMD_BIND(neonserv_cmd_unvisited) {
         printf_mysql_query("SELECT `chanuser_seen` FROM `chanusers` WHERE `chanuser_cid` = '%s' AND `chanuser_access` >= 300 ORDER BY `chanuser_seen` DESC LIMIT 1", row[0]);
         res2 = mysql_use();
         row2 = mysql_fetch_row(res);
-        if(row2 && (time(0) - atoi(row2[0])) < duration) continue;
+        if(row2 && atol(row2[0]) > (time(0) - duration)) continue;
         channel = getChanByName(row[1]);
         if(channel) {
             cache->who_count++;