diff src/context.cpp @ 72:e6a2d0be7c5e

start coding on new config syntax
author carl
date Sun, 10 Jul 2005 13:28:33 -0700
parents dd21c8e13074
children 2b369f7db7bf
line wrap: on
line diff
--- a/src/context.cpp	Sat Jul 09 19:24:41 2005 -0700
+++ b/src/context.cpp	Sun Jul 10 13:28:33 2005 -0700
@@ -1,4 +1,12 @@
-#include "context.h"
+/*
+
+Copyright (c) 2004 Carl Byington - 510 Software Group, released under
+the GPL version 2 or any later version at your choice available at
+http://www.fsf.org/licenses/gpl.txt
+
+*/
+
+#include "includes.h"
 
 static char* context_version="$Id:";
 
@@ -82,11 +90,8 @@
             return con->find_from_context(from);
         }
     }
-    if (default_context) {
         return default_context->find_from_context(from);
     }
-    return NULL;
-}
 
 
 void CONFIG::dump() {
@@ -198,6 +203,18 @@
 }
 
 
+bool CONTEXT::acceptable_content(recorder &memory, char *&msg) {
+    if (memory.excessive_bad_tags(tag_limit)) {
+        msg = tag_limit_message;
+        return false;
+    }
+    if (!host_random && memory.excessive_hosts(host_limit)) {
+        msg = host_limit_message;
+        return false;
+    }
+}
+
+
 void CONTEXT::dump(int level) {
     const int maxlen = 1000;
     char indent[maxlen];
@@ -687,7 +704,7 @@
             return false;
         }
     }
-    return true;
+    return (dc.default_context) ? true : false;
 }