How do I create a heartbeat activity that shows only user related activity? For example, user 1 is related to user 2 and 3 (user relation module). When user 1 is logged in, he should be able to see activity only from user 2 and 3 and not from other users; similarly, it should happen for user 2 and 3. I'm logging the activity using the
The orthodox method of achieving this is to use hook_heartbeat_related_uids().
It works fine, but in order to fine tune according to your own customizations you might want to use hook_heartbeat_load(), and remove unnecessary messages based on a condition you specify.