Blocklist: Track versions of each file

Adjust synchronization
Fix logging for feed file
Prep for a country blocklist (ticket #2759 WIP)
This commit is contained in:
zzz
2020-09-08 13:38:10 +00:00
parent 36318def69
commit 5d1f46e6c4
3 changed files with 96 additions and 43 deletions

View File

@ -23,6 +23,7 @@ import static net.i2p.app.ClientAppState.*;
import net.i2p.crypto.SU3File;
import net.i2p.crypto.TrustedUpdate;
import net.i2p.data.DataHelper;
import net.i2p.router.Blocklist;
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.router.RouterVersion;
@ -144,7 +145,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
notifyInstalled(ROUTER_DEV_SU3, "", RouterVersion.FULL_VERSION);
String blist = _context.getProperty(NewsFetcher.PROP_BLOCKLIST_TIME);
if (blist != null)
notifyInstalled(BLOCKLIST, "", blist);
notifyInstalled(BLOCKLIST, Blocklist.ID_FEED, blist);
// hack to init from the current news file... do this before we register Updaters
// This will not kick off any Updaters as none are yet registered
(new NewsFetcher(_context, this, Collections.<URI> emptyList())).checkForUpdates();

View File

@ -712,7 +712,7 @@ class NewsFetcher extends UpdateRunner {
f.setLastModified(ble.updated);
String upd = Long.toString(ble.updated);
_context.router().saveConfig(PROP_BLOCKLIST_TIME, upd);
_mgr.notifyVersionAvailable(this, _currentURI, BLOCKLIST, "", HTTP,
_mgr.notifyVersionAvailable(this, _currentURI, BLOCKLIST, Blocklist.ID_FEED, HTTP,
null, upd, "");
}
if (_log.shouldWarn())