Save notice-to-status mapping in its own table

Introduce a table mapping notices to Twitter statuses. Initialize
this table at checkSchema() time. Save the mapping when we push
or pull statuses. Use the table to determine if a notice has a
Twitter equivalent.
This commit is contained in:
Evan Prodromou
2010-09-04 23:45:55 -04:00
parent 4aca91d05d
commit 16b219f1ef
4 changed files with 236 additions and 17 deletions

View File

@@ -280,6 +280,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
array('repeat_of' => $original->id,
'uri' => $statusUri));
common_log(LOG_INFO, "Saved {$repeat->id} as a repeat of {$original->id}");
Notice_to_status::saveNew($repeat->id, $status->id);
return $repeat;
}
}
@@ -338,6 +339,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
Event::handle('EndNoticeSave', array($notice));
}
Notice_to_status::saveNew($notice->id, $status->id);
$notice->blowOnInsert();
return $notice;