import net.pterodactylus.sone.freenet.L10nFilter;
import net.pterodactylus.sone.freenet.wot.Identity;
import net.pterodactylus.sone.main.SonePlugin;
+import net.pterodactylus.sone.notify.NewPostNotification;
import net.pterodactylus.sone.notify.NewSoneNotification;
import net.pterodactylus.sone.template.CollectionAccessor;
import net.pterodactylus.sone.template.CssClassNameFilter;
/** The “new Sone” notification. */
private final NewSoneNotification newSoneNotification;
+ /** The “new post” notification. */
+ private final NewPostNotification newPostNotification;
+
/**
* Creates a new web interface.
*
/* create notifications. */
Template newSoneNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newSoneNotification.html"));
newSoneNotification = new NewSoneNotification(newSoneNotificationTemplate);
+
+ Template newPostNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/newPostNotification.html"));
+ newPostNotification = new NewPostNotification(newPostNotificationTemplate);
}
//
*/
@Override
public void newPostFound(Post post) {
- /* TODO */
+ newPostNotification.addPost(post);
+ notificationManager.addNotification(newPostNotification);
}
/**
*/
@Override
public void markPostKnown(Post post) {
- /* TODO */
+ newPostNotification.removePost(post);
+ if (newPostNotification.isEmpty()) {
+ newPostNotification.dismiss();
+ }
}
/**
Notification.Startup.Text=Sone is currently starting up. It may take a while to retrieve all identities and Sones from the web of trust. If you are missing some elements, please be patient, they will probably reappear very soon.
Notification.Button.Dismiss=Dismiss
Notification.NewSone.Text=New Sones have been discovered:
+Notification.NewPost.Text=New posts have been discovered by the following Sones: