Inbox class a bit more consistent in argument order and type

This commit is contained in:
Mikael Nordfeldth
2013-11-09 01:18:44 +01:00
parent 3eac5e6026
commit 729c6eef36
4 changed files with 12 additions and 12 deletions

View File

@@ -50,13 +50,13 @@ class TweetInQueueHandler extends QueueHandler
$importer = new TwitterImport();
$notice = $importer->importStatus($status);
if ($notice) {
if ($notice instanceof Notice) {
$flink = Foreign_link::getByForeignID($receiver, TWITTER_SERVICE);
if ($flink) {
if ($flink instanceof Foreign_link) {
common_log(LOG_DEBUG, "TweetInQueueHandler - Got flink so add notice ".
$notice->id." to inbox ".$flink->user_id);
// @fixme this should go through more regular channels?
Inbox::insertNotice($flink->user_id, $notice->id);
Inbox::insertNotice($notice, $flink->user_id);
}else {
common_log(LOG_DEBUG, "TweetInQueueHandler - No flink found for foreign user ".$receiver);
}

View File

@@ -170,9 +170,9 @@ $stream->hookEvent('status', function($data, $context) {
$importer = new TwitterImport();
printf("\timporting...");
$notice = $importer->importStatus($data);
if ($notice) {
if ($notice instanceof Notice) {
global $myuser;
Inbox::insertNotice($myuser->id, $notice->id);
Inbox::insertNotice($notice, $myuser->id);
printf(" %s\n", $notice->id);
} else {
printf(" FAIL\n");