When activity occurs on the WW site, the following should happen:
Activity item(s) should be posted in the activity stream
If the client site is associated with a group, that group's last_activity should be bumped
The latter is now implemented on openlab.citytech.cuny.edu, though in a fashion that won't work for the distributed plugin. Here's the code:
+
/**
* Update the associated group's last_activity when new content is posted.
*/
function openlab_webwork_bump_group_on_activity( $post_id ) {
// We do this weird parsing because the request comes from the API,
// and we need to maintain compat with openlabdev.org.
$client_site_url = apply_filters( 'webwork_client_site_base', '' );
$parts = parse_url( $client_site_url );
$site = get_site_by_path( $parts['host'], $parts['path'] );
if ( ! $site ) {
return;
}
$group_id = openlab_get_group_id_by_blog_id( $site->blog_id );
if ( ! $group_id ) {
return;
}
groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
}
add_action( 'save_post_webwork_question', 'openlab_webwork_bump_group_on_activity' );
add_action( 'save_post_webwork_response', 'openlab_webwork_bump_group_on_activity' )
General activity integration will have to be group-sensitive based on whatever group-linking protocol we decide on.
When activity occurs on the WW site, the following should happen:
The latter is now implemented on openlab.citytech.cuny.edu, though in a fashion that won't work for the distributed plugin. Here's the code:
General activity integration will have to be group-sensitive based on whatever group-linking protocol we decide on.