diff -Naur ../activitystream.orig/activitystream.module ./activitystream.module --- ../activitystream.orig/activitystream.module 2008-08-05 15:40:04.000000000 -0700 +++ ./activitystream.module 2008-08-06 12:54:57.000000000 -0700 @@ -427,4 +427,52 @@ } watchdog('activitystream', t('Added %title from %name', array('%title' => $node->title, '%name' => $name))); return $node->nid; -} \ No newline at end of file +} + +function activitystream_views_tables() { + $tables = array(); + $tables['activitystream'] = array( + 'name' => 'activitystream', + 'provider' => 'internal', + 'join' => array( + 'left' => array( + 'table' => 'node', + 'field' => 'nid' + ), + 'right' => array( + 'table' => 'activitystream', + 'field' => 'nid' + ) + ), + 'fields' => array( + 'type' => array( + 'name' => t('Activity Stream: Source'), + 'handler' => array( + 'views_handler_field_profile_default' => t('Source') + ) + ) + ), + 'filters' => array( + 'module' => array( + 'name' => t('Activity Stream: Type'), + 'list' => '_activitystream_views_handler_filter_type', + 'list-type' => 'list', + 'operator' => 'views_handler_operator_or', + 'value-type' => 'array', + 'help' => t('Include or exclude feeds of the selected types.') + ) + ) + ); + + return $tables; +} + +function _activitystream_views_handler_filter_type() { + $sources = array(); + $module_list = module_rebuild_cache(); + $implementing_modules = module_implements('streamapi'); + foreach ($implementing_modules as $module_name) { + $sources[$module_name] = $module_list[$module_name]->info['name']; + } + return $sources; +}