summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-09-21 16:27:26 -0700
committerBrion Vibber <brion@pobox.com>2010-09-21 16:27:26 -0700
commit47cf29b2a2fd82b0045dad7686633200479a6b37 (patch)
tree2d60141c8c39f6f9a39c5c9ef78a60dddf3e3424
parent9be9d2f72013a451820e3e3e9e7905466ddb8857 (diff)
Copy favorites in Yammer importer
-rw-r--r--plugins/YammerImport/yammerimporter.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/YammerImport/yammerimporter.php b/plugins/YammerImport/yammerimporter.php
index ae0037ffe..08cbbf790 100644
--- a/plugins/YammerImport/yammerimporter.php
+++ b/plugins/YammerImport/yammerimporter.php
@@ -99,6 +99,12 @@ class YammerImporter
$data['content'],
$data['source'],
$data['options']);
+ foreach ($data['faves'] as $nickname) {
+ $user = User::staticGet('nickname', $nickname);
+ if ($user) {
+ Fave::addNew($user->getProfile(), $notice);
+ }
+ }
// @fixme attachments?
$this->recordImportedNotice($data['orig_id'], $notice->id);
return $notice;
@@ -207,8 +213,13 @@ class YammerImporter
}
$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?
- // Save liked info?
// @todo attachments?
return array('orig_id' => $origId,
@@ -216,7 +227,8 @@ class YammerImporter
'profile' => $profile,
'content' => $content,
'source' => $source,
- 'options' => $options);
+ 'options' => $options,
+ 'faves' => $faves);
}
private function findImportedUser($origId)