Copy favorites in Yammer importer
This commit is contained in:
parent
f36a062f3a
commit
b18c7ee3eb
@ -99,6 +99,12 @@ class YammerImporter
|
|||||||
$data['content'],
|
$data['content'],
|
||||||
$data['source'],
|
$data['source'],
|
||||||
$data['options']);
|
$data['options']);
|
||||||
|
foreach ($data['faves'] as $nickname) {
|
||||||
|
$user = User::staticGet('nickname', $nickname);
|
||||||
|
if ($user) {
|
||||||
|
Fave::addNew($user->getProfile(), $notice);
|
||||||
|
}
|
||||||
|
}
|
||||||
// @fixme attachments?
|
// @fixme attachments?
|
||||||
$this->recordImportedNotice($data['orig_id'], $notice->id);
|
$this->recordImportedNotice($data['orig_id'], $notice->id);
|
||||||
return $notice;
|
return $notice;
|
||||||
@ -207,8 +213,13 @@ class YammerImporter
|
|||||||
}
|
}
|
||||||
$options['created'] = $this->timestamp($item['created_at']);
|
$options['created'] = $this->timestamp($item['created_at']);
|
||||||
|
|
||||||
|
$faves = array();
|
||||||
|
foreach ($item['liked_by']['names'] as $liker) {
|
||||||
|
// "permalink" is the username. wtf?
|
||||||
|
$faves[] = $liker['permalink'];
|
||||||
|
}
|
||||||
|
|
||||||
// Parse/save rendered text?
|
// Parse/save rendered text?
|
||||||
// Save liked info?
|
|
||||||
// @todo attachments?
|
// @todo attachments?
|
||||||
|
|
||||||
return array('orig_id' => $origId,
|
return array('orig_id' => $origId,
|
||||||
@ -216,7 +227,8 @@ class YammerImporter
|
|||||||
'profile' => $profile,
|
'profile' => $profile,
|
||||||
'content' => $content,
|
'content' => $content,
|
||||||
'source' => $source,
|
'source' => $source,
|
||||||
'options' => $options);
|
'options' => $options,
|
||||||
|
'faves' => $faves);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function findImportedUser($origId)
|
private function findImportedUser($origId)
|
||||||
|
Loading…
Reference in New Issue
Block a user