Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: lib/synchronizer.js

Issue 29338611: Issue 3836 - Don't set DownloadableSubscription.upgradeRequired in Synchronizer (Closed)
Patch Set: Created March 18, 2016, 12:31 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 expirationInterval = interval * MILLIS_IN_HOUR; 232 expirationInterval = interval * MILLIS_IN_HOUR;
233 else 233 else
234 expirationInterval = interval * MILLIS_IN_DAY; 234 expirationInterval = interval * MILLIS_IN_DAY;
235 } 235 }
236 } 236 }
237 237
238 let [softExpiration, hardExpiration] = downloader.processExpirationInterval( expirationInterval); 238 let [softExpiration, hardExpiration] = downloader.processExpirationInterval( expirationInterval);
239 subscription.softExpiration = Math.round(softExpiration / MILLIS_IN_SECOND); 239 subscription.softExpiration = Math.round(softExpiration / MILLIS_IN_SECOND);
240 subscription.expires = Math.round(hardExpiration / MILLIS_IN_SECOND); 240 subscription.expires = Math.round(hardExpiration / MILLIS_IN_SECOND);
241 241
242 delete subscription.requiredVersion;
243 delete subscription.upgradeRequired;
244 if (minVersion) 242 if (minVersion)
245 {
246 let {addonVersion} = require("info");
247 subscription.requiredVersion = minVersion; 243 subscription.requiredVersion = minVersion;
248 if (Services.vc.compare(minVersion, addonVersion) > 0) 244 else
249 subscription.upgradeRequired = true; 245 delete subscription.requiredVersion;
250 }
251 246
252 // Process filters 247 // Process filters
253 lines.shift(); 248 lines.shift();
254 let filters = []; 249 let filters = [];
255 for (let line of lines) 250 for (let line of lines)
256 { 251 {
257 line = Filter.normalize(line); 252 line = Filter.normalize(line);
258 if (line) 253 if (line)
259 filters.push(Filter.fromText(line)); 254 filters.push(Filter.fromText(line));
260 } 255 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 let data = "[Adblock]\n" + subscription.filters.map((f) => f.text).j oin("\n"); 306 let data = "[Adblock]\n" + subscription.filters.map((f) => f.text).j oin("\n");
312 redirectCallback("data:text/plain," + encodeURIComponent(data)); 307 redirectCallback("data:text/plain," + encodeURIComponent(data));
313 } 308 }
314 }, false); 309 }, false);
315 request.send(null); 310 request.send(null);
316 } 311 }
317 } 312 }
318 }, 313 },
319 }; 314 };
320 Synchronizer.init(); 315 Synchronizer.init();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld