Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Add beneficiaries to mongo_db. #421
Browse files Browse the repository at this point in the history
  • Loading branch information
afalaleev committed Apr 24, 2018
1 parent fc09611 commit a9cfe82
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plugins/mongo_db/mongo_db_state.cpp
Expand Up @@ -51,6 +51,7 @@ namespace mongo_db {
format_value(body, "allow_votes", comment.allow_votes);
format_value(body, "author_rewards", comment.author_rewards);
format_value(body, "body", comment.body);
format_value(body, "beneficiary_payout", comment.beneficiary_payout_value);
format_value(body, "cashout_time", comment.cashout_time);
format_value(body, "category", comment.category);
format_value(body, "children", comment.children);
Expand All @@ -75,6 +76,17 @@ namespace mongo_db {
format_value(body, "vote_rshares", comment.vote_rshares);
format_value(body, "json_metadata", comment.json_metadata);

if (!comment.beneficiaries.empty()) {
array ben_array;
for (auto& b: comment.beneficiaries) {
document tmp;
format_value(tmp, "account", b.account);
format_value(tmp, "weight", b.weight);
ben_array << tmp;
}
body << "beneficiaries" << ben_array;
}

std::string comment_mode;
switch (comment.mode) {
case first_payout:
Expand Down

0 comments on commit a9cfe82

Please sign in to comment.