diff options
author | Brion Vibber <brion@pobox.com> | 2010-09-21 16:27:26 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-09-28 07:44:21 -0700 |
commit | b18c7ee3eb4b9615636f79327e0d09b85393a900 (patch) | |
tree | 13fc53861b0072eb2c3ed10164f9a72af1c3650e /plugins/YammerImport | |
parent | f36a062f3a6292a19b576e69478234a46d4f81ee (diff) |
Copy favorites in Yammer importer
Diffstat (limited to 'plugins/YammerImport')
-rw-r--r-- | plugins/YammerImport/yammerimporter.php | 16 |
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) |