Skip to content

Commit

Permalink
fix: editPost fixed (core call missing)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicnaum committed Jan 16, 2025
1 parent 1a5ce2a commit dd7919c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contracts/core/primitives/feed/Feed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,20 @@ contract Feed is

function editPost(
uint256 postId,
EditPostParams memory postParams,
EditPostParams calldata postParams,
KeyValue[] memory customParams,
RuleProcessingParams[] memory feedRulesParams,
RuleProcessingParams[] memory rootPostRulesParams,
RuleProcessingParams[] memory quotedPostRulesParams
) external virtual override {
require(Core._postExists(postId), Errors.DoesNotExist());
address author = Core.$storage().posts[postId].author;
// TODO: We can have this for moderators:
// require(msg.sender == author || _hasAccess(msg.sender, EDIT_POST_PID));
require(msg.sender == author, Errors.InvalidMsgSender());

Core._editPost(postId, postParams);

bool[] memory wereExtraDataValuesSet = new bool[](postParams.extraData.length);
for (uint256 i = 0; i < postParams.extraData.length; i++) {
wereExtraDataValuesSet[i] = _setEntityExtraData(postId, postParams.extraData[i]);
Expand Down Expand Up @@ -186,6 +189,7 @@ contract Feed is
KeyValue[] calldata customParams,
RuleProcessingParams[] calldata feedRulesParams
) external virtual override {
require(Core._postExists(postId), Errors.DoesNotExist());
address author = Core.$storage().posts[postId].author;
require(msg.sender == author || _hasAccess(msg.sender, PID__REMOVE_POST), Errors.InvalidMsgSender());
Core._removePost(postId);
Expand Down

0 comments on commit dd7919c

Please sign in to comment.