Merge branch 'next' into edit-wot-trust
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 18 Dec 2010 11:10:49 +0000 (12:10 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 18 Dec 2010 11:10:49 +0000 (12:10 +0100)
1  2 
src/main/java/net/pterodactylus/sone/main/SonePlugin.java
src/main/java/net/pterodactylus/sone/web/WebInterface.java

@@@ -25,8 -25,8 +25,8 @@@ import java.util.logging.Logger
  import net.pterodactylus.sone.core.Core;
  import net.pterodactylus.sone.core.FreenetInterface;
  import net.pterodactylus.sone.freenet.PluginStoreConfigurationBackend;
 +import net.pterodactylus.sone.freenet.plugin.PluginConnector;
  import net.pterodactylus.sone.freenet.wot.IdentityManager;
 -import net.pterodactylus.sone.freenet.wot.PluginConnector;
  import net.pterodactylus.sone.freenet.wot.WebOfTrustConnector;
  import net.pterodactylus.sone.web.WebInterface;
  import net.pterodactylus.util.config.Configuration;
@@@ -78,7 -78,7 +78,7 @@@ public class SonePlugin implements Fred
        }
  
        /** The version. */
-       public static final Version VERSION = new Version(0, 3, 4);
+       public static final Version VERSION = new Version(0, 3, 5, 1);
  
        /** The logger. */
        private static final Logger logger = Logging.getLogger(SonePlugin.class);
@@@ -40,7 -40,6 +40,7 @@@ import net.pterodactylus.sone.data.Repl
  import net.pterodactylus.sone.data.Sone;
  import net.pterodactylus.sone.freenet.L10nFilter;
  import net.pterodactylus.sone.freenet.wot.Identity;
 +import net.pterodactylus.sone.freenet.wot.Trust;
  import net.pterodactylus.sone.main.SonePlugin;
  import net.pterodactylus.sone.notify.ListNotification;
  import net.pterodactylus.sone.template.CollectionAccessor;
@@@ -53,7 -52,6 +53,7 @@@ import net.pterodactylus.sone.template.
  import net.pterodactylus.sone.template.RequestChangeFilter;
  import net.pterodactylus.sone.template.SoneAccessor;
  import net.pterodactylus.sone.template.SubstringFilter;
 +import net.pterodactylus.sone.template.TrustAccessor;
  import net.pterodactylus.sone.web.ajax.CreatePostAjaxPage;
  import net.pterodactylus.sone.web.ajax.CreateReplyAjaxPage;
  import net.pterodactylus.sone.web.ajax.DeletePostAjaxPage;
@@@ -161,7 -159,6 +161,7 @@@ public class WebInterface implements Co
                templateFactory.addAccessor(Reply.class, new ReplyAccessor(getCore(), templateFactory));
                templateFactory.addAccessor(Identity.class, new IdentityAccessor(getCore()));
                templateFactory.addAccessor(NotificationManager.class, new NotificationManagerAccessor());
 +              templateFactory.addAccessor(Trust.class, new TrustAccessor());
                templateFactory.addFilter("date", new DateFilter());
                templateFactory.addFilter("l10n", new L10nFilter(getL10n()));
                templateFactory.addFilter("substring", new SubstringFilter());
         *         currently logged in
         */
        public Sone getCurrentSone(ToadletContext toadletContext) {
-               return getCurrentSone(getCurrentSession(toadletContext));
+               return getCurrentSone(toadletContext, true);
+       }
+       /**
+        * Returns the currently logged in Sone.
+        *
+        * @param toadletContext
+        *            The toadlet context
+        * @param create
+        *            {@code true} to create a new session if no session exists,
+        *            {@code false} to not create a new session
+        * @return The currently logged in Sone, or {@code null} if no Sone is
+        *         currently logged in
+        */
+       public Sone getCurrentSone(ToadletContext toadletContext, boolean create) {
+               return getCurrentSone(getCurrentSession(toadletContext, create));
        }
  
        /**
                        @SuppressWarnings("synthetic-access")
                        public void run() {
                                lockedSonesNotification.add(sone);
+                               lockedSonesTickerObjects.remove(sone);
                                notificationManager.addNotification(lockedSonesNotification);
                        }
                }, "Sone Locked Notification");
         */
        @Override
        public void soneUnlocked(Sone sone) {
-               Object tickerObject = lockedSonesTickerObjects.remove(sone);
-               if (tickerObject == null) {
-                       return;
-               }
                lockedSonesNotification.remove(sone);
-               Ticker.getInstance().deregisterEvent(tickerObject);
+               Ticker.getInstance().deregisterEvent(lockedSonesTickerObjects.remove(sone));
        }
  
        /**