Skip to content

Commit

Permalink
misc: rename removePost to deletePost
Browse files Browse the repository at this point in the history
  • Loading branch information
vicnaum committed Dec 29, 2024
1 parent f17cfd7 commit 47e6095
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 2 additions & 6 deletions contracts/core/interfaces/IFeed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interface IFeed is IMetadataBased {
address indexed source
);

event Lens_Feed_PostRemoved(
event Lens_Feed_PostDeleted(
uint256 indexed postId, address indexed author, KeyValue[] customParams, address indexed source
);

Expand Down Expand Up @@ -136,12 +136,8 @@ interface IFeed is IMetadataBased {
RuleProcessingParams[] calldata quotedPostRulesParams
) external;

// "Delete" - u know u cannot delete stuff from the internet, right? :]
// But this will at least remove it from the current state, so contracts accessing it will know.
// TODO: Debate post deletion, soft vs. hard delete, extra data deletion, etc.
function removePost(
function deletePost(
uint256 postId,
bytes32[] calldata extraDataKeysToRemove,
KeyValue[] calldata customParams,
RuleProcessingParams[] calldata feedRulesParams
) external;
Expand Down
6 changes: 2 additions & 4 deletions contracts/core/primitives/feed/Feed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,8 @@ contract Feed is IFeed, RuleBasedFeed, AccessControlled, ExtraStorageBased, Sour
}
}

// TODO: Decide how DELETE operation should work in Feed (soft vs. hard delete)
function removePost(
function deletePost(
uint256 postId,
bytes32[] calldata, /*extraDataKeysToRemove*/ // TODO: Consider moving this into customParams
KeyValue[] calldata customParams,
RuleProcessingParams[] calldata feedRulesParams
) external override {
Expand All @@ -168,7 +166,7 @@ contract Feed is IFeed, RuleBasedFeed, AccessControlled, ExtraStorageBased, Sour
Core._removePost(postId);
_processPostRemoval(postId, customParams, feedRulesParams);
address source = _processSourceStamp(postId, customParams);
emit Lens_Feed_PostRemoved(postId, author, customParams, source);
emit Lens_Feed_PostDeleted(postId, author, customParams, source);
}

function setExtraData(KeyValue[] calldata extraDataToSet) external override {
Expand Down

0 comments on commit 47e6095

Please sign in to comment.