Author: toad
Date: 2008-04-22 15:15:04 +0000 (Tue, 22 Apr 2008)
New Revision: 19499

Modified:
   trunk/freenet/src/freenet/clients/http/QueueToadlet.java
   trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
   trunk/freenet/src/freenet/node/Announcer.java
   trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
   trunk/freenet/src/freenet/node/useralerts/AbstractUserAlert.java
   trunk/freenet/src/freenet/node/useralerts/ProxyUserAlert.java
   trunk/freenet/src/freenet/node/useralerts/UserAlert.java
Log:
Add isEventNotification() to UserAlert.

Modified: trunk/freenet/src/freenet/clients/http/QueueToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/QueueToadlet.java    2008-04-22 
14:42:40 UTC (rev 19498)
+++ trunk/freenet/src/freenet/clients/http/QueueToadlet.java    2008-04-22 
15:15:04 UTC (rev 19499)
@@ -1223,6 +1223,9 @@
                                        }
                                        saveCompletedIdentifiersOffThread();
                                }
+                               public boolean isEventNotification() {
+                                       return true;
+                               }
                        };
                        core.alerts.register(alert);
                        synchronized(alertsByIdentifier) {
@@ -1248,6 +1251,9 @@
                                        }
                                        saveCompletedIdentifiersOffThread();
                                }
+                               public boolean isEventNotification() {
+                                       return true;
+                               }
                        };
                        core.alerts.register(alert);
                        synchronized(alertsByIdentifier) {
@@ -1274,6 +1280,9 @@
                                        }
                                        saveCompletedIdentifiersOffThread();
                                }
+                               public boolean isEventNotification() {
+                                       return true;
+                               }
                        };
                        core.alerts.register(alert);
                        synchronized(alertsByIdentifier) {

Modified: trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java   
2008-04-22 14:42:40 UTC (rev 19498)
+++ trunk/freenet/src/freenet/clients/http/bookmark/BookmarkItem.java   
2008-04-22 15:15:04 UTC (rev 19499)
@@ -109,6 +109,10 @@
                public String getShortText() {
                        return l10n("bookmarkUpdatedShort", "name", name);
                }
+
+               public boolean isEventNotification() {
+                       return true;
+               }
     }

     private synchronized void disableBookmark() {

Modified: trunk/freenet/src/freenet/node/Announcer.java
===================================================================
--- trunk/freenet/src/freenet/node/Announcer.java       2008-04-22 14:42:40 UTC 
(rev 19498)
+++ trunk/freenet/src/freenet/node/Announcer.java       2008-04-22 15:15:04 UTC 
(rev 19499)
@@ -597,6 +597,10 @@
                        return l10n("announceAlertShort");
                }

+               public boolean isEventNotification() {
+                       return false;
+               }
+
        }

        private String l10n(String key) {

Modified: trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
===================================================================
--- trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2008-04-22 
14:42:40 UTC (rev 19498)
+++ trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2008-04-22 
15:15:04 UTC (rev 19499)
@@ -151,6 +151,10 @@
                public boolean userCanDismiss() {
                        return true;
                }
+
+               public boolean isEventNotification() {
+                       return false;
+               }

        }


Modified: trunk/freenet/src/freenet/node/useralerts/AbstractUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/AbstractUserAlert.java    
2008-04-22 14:42:40 UTC (rev 19498)
+++ trunk/freenet/src/freenet/node/useralerts/AbstractUserAlert.java    
2008-04-22 15:15:04 UTC (rev 19499)
@@ -151,4 +151,7 @@
                return Integer.toString(hashCode());
        }

+       public boolean isEventNotification() {
+               return false;
+       }
 }

Modified: trunk/freenet/src/freenet/node/useralerts/ProxyUserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/ProxyUserAlert.java       
2008-04-22 14:42:40 UTC (rev 19498)
+++ trunk/freenet/src/freenet/node/useralerts/ProxyUserAlert.java       
2008-04-22 15:15:04 UTC (rev 19499)
@@ -88,4 +88,9 @@
                return alert.getShortText();
        }

+       public boolean isEventNotification() {
+               if(alert == null) return false;
+               return alert.isEventNotification();
+       }
+
 }

Modified: trunk/freenet/src/freenet/node/useralerts/UserAlert.java
===================================================================
--- trunk/freenet/src/freenet/node/useralerts/UserAlert.java    2008-04-22 
14:42:40 UTC (rev 19498)
+++ trunk/freenet/src/freenet/node/useralerts/UserAlert.java    2008-04-22 
15:15:04 UTC (rev 19499)
@@ -68,6 +68,13 @@
         */
        public String anchor();

+       /**
+        * @return True if this is an event notification. Event notifications 
can be bulk deleted.
+        * Eventually they will be handled diffferently - logged to a separate 
event log, and only
+        * the last few displayed on the homepage.
+        */
+       public boolean isEventNotification();
+       
        /** An error which prevents normal operation */
        public final static short CRITICAL_ERROR = 0;
        /** An error which prevents normal operation but might be temporary */


Reply via email to