Skip to content

Commit

Permalink
Merge pull request steemit#1099 from steemit/steem-prerelease-v0.18.4
Browse files Browse the repository at this point in the history
Steem prerelease v0.18.4
  • Loading branch information
Michael Vandeberg authored May 10, 2017
2 parents 0b031a7 + 2012341 commit 38a009d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 27 deletions.
23 changes: 1 addition & 22 deletions libraries/app/database_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,28 +1170,7 @@ void database_api::set_pending_payout( discussion& d )const
void database_api::set_url( discussion& d )const
{
const comment_api_obj root( my->_db.get< comment_object, by_id >( d.root_comment ) );
std::vector< std::string > tags;
if( root.json_metadata.size() )
{
try
{
tags = fc::json::from_string( root.json_metadata )["tags"].as< std::vector< std::string > >();
if(tags.at(0) != ""){
d.url = "/" + tags.at(0) + "/@" + root.author + "/" + root.permlink;
}
else {
d.url = "/" + tags.at(1) + "/@" + root.author + "/" + root.permlink;
}
}
catch( const fc::exception& e )
{
// Do nothing on malformed json_metadata
}
}
if(!tags.size()) {
d.url = "/@" + root.author + "/" + root.permlink;
}

d.url = "/" + root.category + "/@" + root.author + "/" + root.permlink;
d.root_title = root.title;
if( root.id != d.id )
d.url += "#@" + d.author + "/" + d.permlink;
Expand Down
3 changes: 2 additions & 1 deletion libraries/app/include/steemit/app/state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace steemit { namespace app {

struct discussion_index
{
string category; /// category by which everything is filtered
vector< string > trending; /// trending posts over the last 24 hours
vector< string > payout; /// pending posts by payout
vector< string > payout_comments; /// pending comments by payout
Expand Down Expand Up @@ -183,7 +184,7 @@ FC_REFLECT_DERIVED( steemit::app::extended_account,
FC_REFLECT( steemit::app::vote_state, (voter)(weight)(rshares)(percent)(reputation)(time) );
FC_REFLECT( steemit::app::account_vote, (authorperm)(weight)(rshares)(percent)(time) );

FC_REFLECT( steemit::app::discussion_index, (trending)(payout)(payout_comments)(trending30)(updated)(created)(responses)(active)(votes)(maturing)(best)(hot)(promoted)(cashout) )
FC_REFLECT( steemit::app::discussion_index, (category)(trending)(payout)(payout_comments)(trending30)(updated)(created)(responses)(active)(votes)(maturing)(best)(hot)(promoted)(cashout) )
FC_REFLECT( steemit::app::tag_index, (trending) )
FC_REFLECT_DERIVED( steemit::app::discussion, (steemit::app::comment_api_obj), (url)(root_title)(pending_payout_value)(total_pending_payout_value)(active_votes)(replies)(author_reputation)(promoted)(body_length)(reblogged_by)(first_reblogged_by)(first_reblogged_on) )

Expand Down
4 changes: 3 additions & 1 deletion libraries/app/include/steemit/app/steem_api_objects.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ struct comment_api_obj
{
comment_api_obj( const chain::comment_object& o ):
id( o.id ),
category( to_string( o.category ) ),
parent_author( o.parent_author ),
parent_permlink( to_string( o.parent_permlink ) ),
author( o.author ),
Expand Down Expand Up @@ -101,6 +102,7 @@ struct comment_api_obj
comment_api_obj(){}

comment_id_type id;
string category;
account_name_type parent_author;
string parent_permlink;
account_name_type author;
Expand Down Expand Up @@ -480,7 +482,7 @@ struct signed_block_api_obj : public signed_block

FC_REFLECT( steemit::app::comment_api_obj,
(id)(author)(permlink)
(parent_author)(parent_permlink)
(category)(parent_author)(parent_permlink)
(title)(body)(json_metadata)(last_update)(created)(active)(last_payout)
(depth)(children)
(net_rshares)(abs_rshares)(vote_rshares)
Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/include/steemit/chain/comment_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ namespace steemit { namespace chain {
} } // steemit::chain

FC_REFLECT( steemit::chain::comment_object,
(id)(category)(author)(permlink)
(parent_author)(parent_permlink)
(id)(author)(permlink)
(category)(parent_author)(parent_permlink)
(title)(body)(json_metadata)(last_update)(created)(active)(last_payout)
(depth)(children)
(net_rshares)(abs_rshares)(vote_rshares)
Expand Down
2 changes: 2 additions & 0 deletions libraries/chain/steem_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ void comment_evaluator::do_apply( const comment_operation& o )
{
com.parent_author = "";
from_string( com.parent_permlink, o.parent_permlink );
from_string( com.category, o.parent_permlink );
com.root_comment = com.id;
com.cashout_time = _db.has_hardfork( STEEMIT_HARDFORK_0_12__177 ) ?
_db.head_block_time() + STEEMIT_CASHOUT_WINDOW_SECONDS_PRE_HF17 :
Expand All @@ -572,6 +573,7 @@ void comment_evaluator::do_apply( const comment_operation& o )
com.parent_author = parent->author;
com.parent_permlink = parent->permlink;
com.depth = parent->depth + 1;
com.category = parent->category;
com.root_comment = parent->root_comment;
com.cashout_time = fc::time_point_sec::maximum();
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/protocol/include/steemit/protocol/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
#pragma once

#define STEEMIT_BLOCKCHAIN_VERSION ( version(0, 18, 3) )
#define STEEMIT_BLOCKCHAIN_VERSION ( version(0, 18, 4) )
#define STEEMIT_BLOCKCHAIN_HARDFORK_VERSION ( hardfork_version( STEEMIT_BLOCKCHAIN_VERSION ) )

#ifdef IS_TEST_NET
Expand Down

0 comments on commit 38a009d

Please sign in to comment.