You are viewing the Feeds v2 documentation. Feeds v2 is in maintenance mode and no longer receives new features. New projects should use Feeds v3, a major upgrade in performance, capabilities, and developer experience. To move an existing app, follow the migration guide.

Child Reactions

A reaction can also be added to another reaction; in this case, a child reaction is created. Child reactions are created in the same way as regular reactions but have a few crucial differences:

  • Child reactions are not part of the parent activity counts

  • Child reactions are only returned when the parent is returned

  • In order to paginate over reactions, you need to filter using the parent reaction ID

  • Recent children reactions and their counts are added to the parent reaction body

Reaction nesting is limited. The deepest level where you can insert your child reaction is 3.

Let's take an example: Bob creates an activity

  1. Alice comments on this activity

  2. Bob comments on Alice's comment

  3. Carl comments on Bob's comment.

Carl's comment is at the maximum third nesting level, so Alice can't like or comment on Carl's comment because it would be the fourth level of nesting.

// adds a like to the previously created comment
	r := stream.AddReactionRequestObject{
		Kind:    "like",
		ActivityID: activity.ID,
		UserID:   "bob",
	}
	resp, err := client.Reactions().AddChild(context.TODO(), comment.ID, r)
	if err != nil {
		panic(err)
	}