diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 17ce8e4623..292af658ed 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -476,7 +476,6 @@ class OStatusPlugin extends Plugin function onCheckSchema() { $schema = Schema::get(); $schema->ensureTable('ostatus_profile', Ostatus_profile::schemaDef()); - $schema->ensureTable('ostatus_source', Ostatus_source::schemaDef()); $schema->ensureTable('feedsub', FeedSub::schemaDef()); $schema->ensureTable('hubsub', HubSub::schemaDef()); $schema->ensureTable('magicsig', Magicsig::schemaDef()); diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 8c7be80a60..2b1ab8ddd9 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -539,7 +539,6 @@ class Ostatus_profile extends Managed_DataObject try { $stored = Notice::saveActivity($activity, $actor, $options); - Ostatus_source::saveNew($stored, $this, $method); } catch (Exception $e) { common_log(LOG_ERR, "OStatus save of remote message $sourceUri failed: " . $e->getMessage()); throw $e; diff --git a/plugins/OStatus/classes/Ostatus_source.php b/plugins/OStatus/classes/Ostatus_source.php deleted file mode 100644 index 88a6a58383..0000000000 --- a/plugins/OStatus/classes/Ostatus_source.php +++ /dev/null @@ -1,77 +0,0 @@ -. - */ - -if (!defined('STATUSNET')) { - exit(1); -} - -/** - * @package OStatusPlugin - * @maintainer Brion Vibber - */ -class Ostatus_source extends Managed_DataObject -{ - public $__table = 'ostatus_source'; - - public $notice_id; // notice we're referring to - public $profile_uri; // uri of the ostatus_profile this came through -- may be a group feed - public $method; // push or salmon - public $created; - public $modified; - - public static function schemaDef() - { - return array( - 'fields' => array( - 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'Notice ID relation'), - 'profile_uri' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'Profile URI'), - 'method' => array('type' => 'enum("push","salmon")', 'not null' => true, 'description' => 'source method'), - 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'), - 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'), - ), - 'primary key' => array('notice_id'), - 'foreign keys' => array( - 'ostatus_source_notice_id_fkey' => array('notice', array('notice_id' => 'id')), - // not in profile table yet 'ostatus_source_profile_uri_fkey' => array('profile', array('profile_uri' => 'uri')), - ), - 'indexes' => array( - 'ostatus_source_profile_uri_idx' => array('profile_uri'), - ), - ); - } - - /** - * Save a remote notice source record; this helps indicate how trusted we are. - * @param string $method - */ - public static function saveNew(Notice $notice, Ostatus_profile $oprofile, $method) - { - $osource = new Ostatus_source(); - $osource->notice_id = $notice->id; - $osource->profile_uri = $oprofile->uri; - $osource->method = $method; - $osource->created = common_sql_now(); - if ($osource->insert()) { - return true; - } else { - common_log_db_error($osource, 'INSERT', __FILE__); - return false; - } - } -}