Activities
Activities includes all social activities that you do in Subsocial chain. It unifies all the events that occur on chain to one single query. It supports events listed below:
- Post - Created, Deleted, Updated, Shared, Moved
- PostReaction - Created, Updated, Deleted
- Space - Created, Updated, Followed, Unfollowed, OwnershipTransferAccepted
- Account - Followed, Unfollowed
- Profile - Updated
- Comment - Created, Deleted, Updated, Shared
- CommentReaction - Created, Updated, Deleted
- CommentReply - Created, Deleted, Updated, Shared
- CommentReplyReaction - Created, Updated, Deleted
- UserName - Registered, Updated
You can filter or differentiate activities based on their events, where they are enums which corresponds to the event name. For example, PostCreated, PostUpdated, etc.
Common Attributes
Common attributes that every activity has are listed as below:
- id
- account
- blockNumber
- eventIndex
- event
- date
- aggregated
- aggCount
Similar activities are grouped together and aggregated. The aggregated attribute is a boolean value that indicates whether the activity is aggregated or not. The aggCount attribute is the number of similar activities. Examples of similar activities mentioned before are when account A and B likes your post Z, or when account A and B follows your account. Those activities are considered similar activities the latest activity for that group will have the aggregated value to true with the aggCount corresponds to how many similar activities prior to the latest activity.
For example, in the case where 2 accounts like your post Z:
- Account A likes your post Z - It will create 1 new activity, where the
aggregatedvalue istrueandaggCountis 0. - Account B likes your post Z - It will create 1 new activity, where the
aggregatedvalue istrueandaggCountis 1. And all the previous activity in that group will be updated with theaggregatedvalue tofalse.
Optional Attributes
Whereas listed below are the optional attributes which only filled if the attribute is related to the event:
- followingAccount
- space
- spacePrev
- newOwner
- oldOwner
- post
- reaction
- username