Skip to content

Commit

Permalink
only author
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Damer committed Jun 5, 2023
1 parent b106341 commit a888e7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/superclasses/Posts.sol
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ contract Posts is KetlGuarded {
? posts[feedId][postId]
: comments[feedId][postId][commentId - 1]; // -1 because commentIds starts with 1
// Check if post or comment exists
require(post.sender != address(0), "Post or comment not found");
require(post.author != address(0), "Post or comment not found");
// Get old reaction if it exists
Reaction memory oldReaction = usersToReactions[feedId][postId][commentId][
sender
Expand Down Expand Up @@ -370,7 +370,7 @@ contract Posts is KetlGuarded {
lastReactionIds[feedId][postId][commentId].increment();
// If ether was sent, transfer it to the sender
if (msg.value > 0) {
Address.sendValue(payable(post.sender), msg.value);
Address.sendValue(payable(post.author), msg.value);
}
// Emit the event
emit ReactionAdded(
Expand Down Expand Up @@ -402,7 +402,7 @@ contract Posts is KetlGuarded {
? posts[feedId][postId]
: comments[feedId][postId][commentId - 1]; // -1 because commentIds starts with 1
// Check if post or comment exists
require(post.sender != address(0), "Post or comment not found");
require(post.author != address(0), "Post or comment not found");
// Check if sent by the owner
require(
reactions[feedId][postId][commentId][reactionId].sender == sender,
Expand All @@ -425,7 +425,7 @@ contract Posts is KetlGuarded {
? posts[feedId][postId]
: comments[feedId][postId][commentId - 1]; // -1 because commentIds starts with 1
// Check if post or comment exists
require(post.sender != address(0), "Post or comment not found");
require(post.author != address(0), "Post or comment not found");
// Get the number of reactions
uint reactionsLength = lastReactionIds[feedId][postId][commentId].current();
// Create the array of reactions
Expand Down

0 comments on commit a888e7f

Please sign in to comment.