Author: nextgens
Date: 2006-05-20 16:21:38 +0000 (Sat, 20 May 2006)
New Revision: 8801

Modified:
   trunk/freenet/src/freenet/node/MeaningfulNodeNameUserAlert.java
   trunk/freenet/src/freenet/node/Node.java
   trunk/freenet/src/freenet/node/NodeStarter.java
Log:
Enforces the node's name policy : we want people to put a mail address there so 
that they can be reached.

Modified: trunk/freenet/src/freenet/node/MeaningfulNodeNameUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/MeaningfulNodeNameUserAlert.java     
2006-05-20 14:25:44 UTC (rev 8800)
+++ trunk/freenet/src/freenet/node/MeaningfulNodeNameUserAlert.java     
2006-05-20 16:21:38 UTC (rev 8801)
@@ -16,7 +16,8 @@
                "up a node name doesn't affect your anonymity in any way but "+
                "is useful for your peers to know who you are in case they have 
"+
                "to reach you. You can change the node's name at the 
Configuration page. "+
-               "Putting your e-mail address there is generally speaking a good 
idea.";
+               "Putting your e-mail address there is generally speaking a good 
idea."+
+               "<br> Example : John Doe (bigbrother at nsa.gov) ";
        }

        public short getPriorityClass() {

Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java    2006-05-20 14:25:44 UTC (rev 
8800)
+++ trunk/freenet/src/freenet/node/Node.java    2006-05-20 16:21:38 UTC (rev 
8801)
@@ -303,8 +303,15 @@
                        NodeNameCallback(Node n) {
                                node=n;
                        }
+                       
+                       public boolean check(String myName){
+                               return  (myName.startsWith("Node created 
around")||
+                                               
myName.equals("MyFirstFreenetNode")||
+                                               !myName.matches("^.* .*@.*$"));
+                       }
+                       
                        public String get() {
-                               if(myName.startsWith("Node created around")|| 
myName.equals("MyFirstFreenetNode")){
+                               if(check(myName)){
                                node.alerts.register(nodeNameUserAlert);
                        }else{
                                node.alerts.unregister(nodeNameUserAlert);
@@ -314,7 +321,7 @@

                        public void set(String val) throws 
InvalidConfigValueException {
                                myName = val;
-                               if(myName.startsWith("Node created around")|| 
myName.equals("MyFirstFreenetNode")){
+                               if(check(myName)){
                                node.alerts.register(nodeNameUserAlert);
                        }else{
                                node.alerts.unregister(nodeNameUserAlert);

Modified: trunk/freenet/src/freenet/node/NodeStarter.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeStarter.java     2006-05-20 14:25:44 UTC 
(rev 8800)
+++ trunk/freenet/src/freenet/node/NodeStarter.java     2006-05-20 16:21:38 UTC 
(rev 8801)
@@ -107,6 +107,9 @@
        // t.setPriority(Thread.MAX_PRIORITY);
        // t.start();

+       // The node can take time to start up (DS checking)
+       WrapperManager.signalStarting(120000);
+       
        try {
                node = new Node(cfg, random, logConfigHandler,this);
                node.start(false);


Reply via email to