I needed to add time delays to Activity 2.x as people were updating content over and over within seconds of a previous updates and the stream was starting to look a bit messy and useless.
I think, if I remember from my brief use of it, that 1.x allowed for time limits but the feature wasn't there in 2.x. I decided to add it.
The patch creates adds 2 settings to the settings page for Delay after node/comment creation and Delay between updates, both defaulting to zero (no delay, store all activity). The first setting will probably be optional for most people but I have found that users create a node and then decide to immediately edit it after noticing spelling mistakes so I wanted to allow admins to set a limit before recording the first update for a node/comment. The second setting will ensure that, if an update occurs, Activity doesn't record another update for the same node by the same user for the selected amount of time (this should always be the node author in the current iteration of Activity 2.x).
The node_activity_type_check and comment_activity_type_check functions have been updated and check based on user as well as node so that Activity will record for different people updating content without checking the delay.
I have also created a small module to alter the way activity records the user id for an activity, it always stores the global user as the user performing the action unless it is an action on a profile node (created by Content Profile). This means that if you add user picture to your Activity views you can include the picture of the updater for node activities or the node author when it is a profile related activity - sweet!
A few examples of how this works with my hook module:
Assuming there are publisher templates for node insert and node update, if we had settings at 1 hour delay for first update and 10 minutes for delay between updates:
Assuming there are publisher templates for node insert and node update, if we had settings at 1 hour delay for first update and 10 minutes for delay between updates:
Note that the update that User B did before the 1 hour delay after User A created the node was not recorded but the update at 16:35 was recorded, even though there is a 10 minute delay. The delays are designed to stop duplicate activity records for the same user within the time limit. User B was a different user updating so logically we want to record this activity as well.
This patch should work fairly seemlessly with the current dev iteration even without my hooks module but, if people want it, I have also attached my Activity Mods module which can be activated from the Activity section on the modules page. It is only a few lines for one alter so no point in adding it to Drupal contrib.
Hope this helps others with the similar issues. Any feedback or suggestions will be welcomed.
Closed: outdated
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.