1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-24 09:42:28 +01:00

Respect 'sanitizetimespan' in command history sanitization.

This commit is contained in:
Kris Maglione
2009-09-10 16:33:36 -04:00
parent 444e016428
commit ed38331178
2 changed files with 11 additions and 3 deletions

View File

@@ -167,10 +167,16 @@ function CommandLine() //{{{
/**
* Removes any private data from this history.
*/
sanitize: function ()
sanitize: function (timespan)
{
// TODO: Respect privacy.item.timeSpan (options["sts"])
this.store.mutate("filter", function (line) !line.privateData);
let range = [0, Number.MAX_VALUE];
if (liberator.has("sanitizer") && (timespan || options["sanitizetimespan"]))
range = sanitizer.getClearRange(timespan || options["sanitizetimespan"]);
this.store.mutate("filter", function (item) {
let timestamp = (item.timestamp || Date.now()/1000) * 1000;
return !line.privateData || timestamp < self.range[0] || timestamp > self.range[1];
});
},
/**
* Replace the current input field value.