mirror of
https://github.com/lens-protocol/core.git
synced 2026-04-22 03:02:03 -04:00
feat: Timestamp added to (Un)Blocked events and small fix
This commit is contained in:
@@ -338,14 +338,14 @@ library Events {
|
||||
* @param idOfProfileFollowed The ID of the profile that was followed.
|
||||
* @param followTokenIdAssigned The ID of the follow token assigned to the follower.
|
||||
* @param followModuleData The data to passed to the follow module, if any.
|
||||
* @param followTimestamp The timestamp of the follow operation.
|
||||
* @param timestamp The timestamp of the follow operation.
|
||||
*/
|
||||
event Followed(
|
||||
uint256 indexed followerProfileId,
|
||||
uint256 idOfProfileFollowed,
|
||||
uint256 followTokenIdAssigned,
|
||||
bytes followModuleData,
|
||||
uint256 followTimestamp
|
||||
uint256 timestamp
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -353,12 +353,12 @@ library Events {
|
||||
*
|
||||
* @param unfollowerProfileId The ID of the profile that executed the unfollow.
|
||||
* @param idOfProfileUnfollowed The ID of the profile that was unfollowed.
|
||||
* @param unfollowTimestamp The timestamp of the unfollow operation.
|
||||
* @param timestamp The timestamp of the unfollow operation.
|
||||
*/
|
||||
event Unfollowed(
|
||||
uint256 indexed unfollowerProfileId,
|
||||
uint256 idOfProfileUnfollowed,
|
||||
uint256 unfollowTimestamp
|
||||
uint256 timestamp
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -366,16 +366,18 @@ library Events {
|
||||
*
|
||||
* @param byProfileId The ID of the profile that executed the block status change.
|
||||
* @param idOfProfileBlocked The ID of the profile whose block status have been set to blocked.
|
||||
* @param timestamp The timestamp of the block operation.
|
||||
*/
|
||||
event Blocked(uint256 indexed byProfileId, uint256 idOfProfileBlocked);
|
||||
event Blocked(uint256 indexed byProfileId, uint256 idOfProfileBlocked, uint256 timestamp);
|
||||
|
||||
/**
|
||||
* @dev Emitted upon a successful unblock, through a block status setting operation.
|
||||
*
|
||||
* @param byProfileId The ID of the profile that executed the block status change.
|
||||
* @param idOfProfileUnblocked The ID of the profile whose block status have been set to unblocked.
|
||||
* @param timestamp The timestamp of the unblock operation.
|
||||
*/
|
||||
event Unblocked(uint256 indexed byProfileId, uint256 idOfProfileUnblocked);
|
||||
event Unblocked(uint256 indexed byProfileId, uint256 idOfProfileUnblocked, uint256 timestamp);
|
||||
|
||||
/**
|
||||
* @dev Emitted via callback when a followNFT is transferred.
|
||||
|
||||
@@ -139,24 +139,25 @@ library InteractionHelpers {
|
||||
}
|
||||
uint256 i;
|
||||
uint256 idOfProfileToSetBlockStatus;
|
||||
bool blocked;
|
||||
bool setToBlocked;
|
||||
while (i < idsOfProfilesToSetBlockStatus.length) {
|
||||
idOfProfileToSetBlockStatus = idsOfProfilesToSetBlockStatus[i];
|
||||
_validateProfileExists(idOfProfileToSetBlockStatus);
|
||||
if (followNFT != address(0) && (blocked = blockStatus[i])) {
|
||||
setToBlocked = blockStatus[i];
|
||||
if (followNFT != address(0) && setToBlocked) {
|
||||
IFollowNFT(followNFT).block(idOfProfileToSetBlockStatus);
|
||||
}
|
||||
// Stores the block status.
|
||||
// i.e. `_blockStatusByProfileIdByBlockeeProfileId[byProfileId][idOfProfileToSetBlockStatus] = blocked;`
|
||||
// i.e. `_blockStatusByProfileIdByBlockeeProfileId[byProfileId][idOfProfileToSetBlockStatus] = setToBlocked;`
|
||||
assembly {
|
||||
mstore(0, idOfProfileToSetBlockStatus)
|
||||
mstore(32, blockStatusByProfileSlot)
|
||||
sstore(keccak256(0, 64), blocked)
|
||||
sstore(keccak256(0, 64), setToBlocked)
|
||||
}
|
||||
if (blocked) {
|
||||
emit Events.Blocked(byProfileId, idOfProfileToSetBlockStatus);
|
||||
if (setToBlocked) {
|
||||
emit Events.Blocked(byProfileId, idOfProfileToSetBlockStatus, block.timestamp);
|
||||
} else {
|
||||
emit Events.Unblocked(byProfileId, idOfProfileToSetBlockStatus);
|
||||
emit Events.Unblocked(byProfileId, idOfProfileToSetBlockStatus, block.timestamp);
|
||||
}
|
||||
unchecked {
|
||||
++i;
|
||||
|
||||
Reference in New Issue
Block a user