- Force news refetch after URL change

This commit is contained in:
zzz
2011-05-23 19:19:07 +00:00
parent 7ab95d0144
commit 6e4df8830a
2 changed files with 16 additions and 2 deletions

View File

@@ -1,6 +1,5 @@
package net.i2p.router.web;
import net.i2p.I2PAppContext;
import net.i2p.crypto.TrustedUpdate;
import net.i2p.data.DataHelper;
import net.i2p.util.FileUtil;
@@ -78,7 +77,7 @@ public class ConfigUpdateHandler extends FormHandler {
if (_action == null)
return;
if (_action.equals(_("Check for updates"))) {
NewsFetcher fetcher = NewsFetcher.getInstance(I2PAppContext.getGlobalContext());
NewsFetcher fetcher = NewsFetcher.getInstance(_context);
fetcher.fetchNews();
if (fetcher.shouldFetchUnsigned())
fetcher.fetchUnsignedHead();
@@ -100,6 +99,7 @@ public class ConfigUpdateHandler extends FormHandler {
String oldURL = ConfigUpdateHelper.getNewsURL(_context);
if ( (oldURL == null) || (!_newsURL.equals(oldURL)) ) {
_context.router().setConfigSetting(PROP_NEWS_URL, _newsURL);
NewsFetcher.getInstance(_context).invalidateNews();
addFormNotice(_("Updating news URL to") + " " + _newsURL);
}
}