import javax.inject.Singleton;
import net.pterodactylus.sone.core.event.UpdateFoundEvent;
+import net.pterodactylus.sone.main.PluginHomepage;
import net.pterodactylus.sone.main.SonePlugin;
import net.pterodactylus.util.io.Closer;
import net.pterodactylus.util.version.Version;
/** The release date of the latest version. */
private long latestVersionDate;
+ private final PluginHomepage pluginHomepage;
+
/**
* Creates a new update checker.
*
* The freenet interface to use
*/
@Inject
- public UpdateChecker(EventBus eventBus, FreenetInterface freenetInterface, Version currentVersion) {
+ public UpdateChecker(EventBus eventBus, FreenetInterface freenetInterface, Version currentVersion, PluginHomepage pluginHomepage) {
this.eventBus = eventBus;
this.freenetInterface = freenetInterface;
this.currentRunningVersion = currentVersion;
this.currentLatestVersion = currentVersion;
+ this.pluginHomepage = pluginHomepage;
}
//
*/
public void start() {
try {
- currentUri = new FreenetURI(SonePlugin.getHomepage());
+ currentUri = new FreenetURI(pluginHomepage.getHomepage());
} catch (MalformedURLException mue1) {
/* this can not really happen unless I screw up. */
logger.log(Level.SEVERE, "Sone Homepage URI invalid!", mue1);
return YEAR;
}
- public static String getHomepage() {
+ public String getHomepage() {
return SONE_HOMEPAGE + LATEST_EDITION;
}
pageToadlets.add(pageToadletFactory.createPageToadlet(new LogoutPage(emptyTemplate, this), "Logout"));
pageToadlets.add(pageToadletFactory.createPageToadlet(new OptionsPage(optionsTemplate, this), "Options"));
pageToadlets.add(pageToadletFactory.createPageToadlet(new RescuePage(rescueTemplate, this), "Rescue"));
- pageToadlets.add(pageToadletFactory.createPageToadlet(new AboutPage(aboutTemplate, this, new PluginVersion(SonePlugin.getPluginVersion()), new PluginYear(sonePlugin.getYear()), new PluginHomepage(SonePlugin.getHomepage())), "About"));
+ pageToadlets.add(pageToadletFactory.createPageToadlet(new AboutPage(aboutTemplate, this, new PluginVersion(SonePlugin.getPluginVersion()), new PluginYear(sonePlugin.getYear()), new PluginHomepage(sonePlugin.getHomepage())), "About"));
pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("noPermission.html", this, noPermissionTemplate, "Page.NoPermission.Title")));
pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("emptyImageTitle.html", this, emptyImageTitleTemplate, "Page.EmptyImageTitle.Title")));
pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("emptyAlbumTitle.html", this, emptyAlbumTitleTemplate, "Page.EmptyAlbumTitle.Title")));
import net.pterodactylus.sone.core.FreenetInterface.Callback;
import net.pterodactylus.sone.core.event.UpdateFoundEvent;
+import net.pterodactylus.sone.main.PluginHomepage;
import net.pterodactylus.util.version.Version;
import freenet.client.ClientMetadata;
private final EventBus eventBus = mock(EventBus.class);
private final FreenetInterface freenetInterface = mock(FreenetInterface.class);
private final Version currentVersion = new Version(1, 0, 0);
- private final UpdateChecker updateChecker = new UpdateChecker(eventBus, freenetInterface, currentVersion);
+ private final PluginHomepage pluginHomepage = new PluginHomepage("KSK@homepage");
+ private final UpdateChecker updateChecker = new UpdateChecker(eventBus, freenetInterface, currentVersion, pluginHomepage);
@Before
public void startUpdateChecker() {