There is no Activity:Comment relationship available for Views. I would like to assign flags to comments which appear in a view of type activity, but the only relationships available are Activity:Node and Activity:User, so flags cannot be assigned to comments.
Comments
Comment #1
Scott Reynolds commentedUnfort, this was left out on purpose. Each Activity that is recorded always has a user, therefore, then it can safely be assumed that a relationship exists between users and Activity.
For nodes, there is a special column that can be NULL or be the nid. This was done so that Activity could respect node_access controls (i.e. A comment on a node in a private group should only be surfaced to those who are members of the private group). Nodes are the only entities that have this type of access control.
The unique comment id is recorded in the activity.eid field. So to create a relationship, it would JOIN on type == 'comment' AND eid = comment.cid. Which admittedly, works for almost all cases. But it bears no resemblance to the User and Node relationships as both have special unique columns.
So I will help you write one, its very straight forward, but not sure I want to get in the habit of writing relationships for every Activity type. I guess it could be done though, loop over all activity infos, if it has an eid_field create a relationship.
They lack though the power of the nid and the user relationship. For instance, a comment Activity has a nid, so you can have a node flag and a comment flag on the same piece of Activity.
Essentially, boiling down to any Activity type can have a nid, whereas, with comments that isn't true. Only comment Activities can have a cid.
Comment #2
sirkitree commentedSince this was left out on purpose, closing as won't fix.