import net.pterodactylus.sone.freenet.L10nFilter;
import net.pterodactylus.sone.freenet.wot.Identity;
import net.pterodactylus.sone.main.SonePlugin;
+import net.pterodactylus.sone.notify.NewSoneNotification;
import net.pterodactylus.sone.template.CollectionAccessor;
import net.pterodactylus.sone.template.CssClassNameFilter;
import net.pterodactylus.sone.template.GetPagePlugin;
/** The template factory. */
private DefaultTemplateFactory templateFactory;
+ /** The “new Sone” notification. */
+ private final NewSoneNotification newSoneNotification;
+
/**
* Creates a new web interface.
*
templateFactory.addPlugin("paginate", new PaginationPlugin());
templateFactory.setTemplateProvider(new ClassPathTemplateProvider(templateFactory));
templateFactory.addTemplateObject("formPassword", formPassword);
+
+ /* create notifications. */
+ Template newSoneNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newSoneNotification.html"));
+ newSoneNotification = new NewSoneNotification(newSoneNotificationTemplate);
}
//
}
/**
+ * {@inheritDoc}
+ */
+ @Override
+ public void markSoneKnown(Sone sone) {
+ newSoneNotification.removeSone(sone);
+ if (newSoneNotification.isEmpty()) {
+ newSoneNotification.dismiss();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void markPostKnown(Post post) {
+ /* TODO */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void markReplyKnown(Reply reply) {
+ /* TODO */
+ }
+
+ /**
* Template provider implementation that uses
* {@link WebInterface#createReader(String)} to load templates for
* inclusion.