summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-12 14:43:40 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-12 14:43:40 -0400
commita1fc3c5cfe2ff1fa01c488d4e130b6592be1f111 (patch)
tree2e8d66584569fa7ef278695ddb78d11676375fff /src/filters.cc
parent0fb6bf4189c57802fafb611f18f419cd6b588ac4 (diff)
downloadfork-ledger-a1fc3c5cfe2ff1fa01c488d4e130b6592be1f111.tar.gz
fork-ledger-a1fc3c5cfe2ff1fa01c488d4e130b6592be1f111.tar.bz2
fork-ledger-a1fc3c5cfe2ff1fa01c488d4e130b6592be1f111.zip
The --anon option now randomizes its effect
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 819e3d97..86386f58 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -270,8 +270,12 @@ void anonymize_posts::operator()(post_t& post)
if (copy_xact_details) {
xact.copy_details(*post.xact);
+ std::ostringstream buf;
+ buf << reinterpret_cast<uintmax_t>(post.xact->payee.c_str())
+ << integer_gen() << post.xact->payee.c_str();
+
sha.Reset();
- sha << post.xact->payee.c_str();
+ sha << buf.str().c_str();
sha.Result(message_digest);
xact.payee = to_hex(message_digest);
@@ -283,8 +287,11 @@ void anonymize_posts::operator()(post_t& post)
for (account_t * acct = post.account;
acct;
acct = acct->parent) {
+ std::ostringstream buf;
+ buf << integer_gen() << acct << acct->fullname();
+
sha.Reset();
- sha << acct->name.c_str();
+ sha << buf.str().c_str();
sha.Result(message_digest);
account_names.push_front(to_hex(message_digest));
@@ -296,9 +303,7 @@ void anonymize_posts::operator()(post_t& post)
temp.note = none;
temp.add_flags(POST_ANONYMIZED);
- DEBUG("foo", "1.rendering amount: " << temp.amount);
render_commodity(temp.amount);
- DEBUG("foo", "2.rendering amount: " << temp.amount);
if (temp.amount.has_annotation()) {
temp.amount.annotation().tag = none;
if (temp.amount.annotation().price)