diff options
author | Brion Vibber <brion@pobox.com> | 2010-09-21 23:19:36 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-09-28 07:44:22 -0700 |
commit | e6e8a16f1c22294770a653047f50aa0a126395c6 (patch) | |
tree | d0590995d748d4fd8bfa5a731421a8736de30599 /plugins/YammerImport/yammerimporter.php | |
parent | 6bc3f5aacbdefcd2bb2d46998bc439903ffa3a1d (diff) |
Fixes for Yammer groups import: pulling explicit list, fixed avatar fetch
Diffstat (limited to 'plugins/YammerImport/yammerimporter.php')
-rw-r--r-- | plugins/YammerImport/yammerimporter.php | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/plugins/YammerImport/yammerimporter.php b/plugins/YammerImport/yammerimporter.php index bfe486770..9ce0d1e58 100644 --- a/plugins/YammerImport/yammerimporter.php +++ b/plugins/YammerImport/yammerimporter.php @@ -51,10 +51,12 @@ class YammerImporter } else { $user = User::register($data['options']); $profile = $user->getProfile(); - try { - $this->saveAvatar($data['avatar'], $profile); - } catch (Exception $e) { - common_log(LOG_ERROR, "Error importing Yammer avatar: " . $e->getMessage()); + if ($data['avatar']) { + try { + $this->saveAvatar($data['avatar'], $profile); + } catch (Exception $e) { + common_log(LOG_ERR, "Error importing Yammer avatar: " . $e->getMessage()); + } } $this->recordImportedUser($data['orig_id'], $profile->id); return $profile; @@ -76,10 +78,12 @@ class YammerImporter return User_group::staticGet('id', $groupId); } else { $group = User_group::register($data['options']); - try { - $this->saveAvatar($data['avatar'], $group); - } catch (Exception $e) { - common_log(LOG_ERROR, "Error importing Yammer avatar: " . $e->getMessage()); + if ($data['avatar']) { + try { + $this->saveAvatar($data['avatar'], $group); + } catch (Exception $e) { + common_log(LOG_ERR, "Error importing Yammer avatar: " . $e->getMessage()); + } } $this->recordImportedGroup($data['orig_id'], $group->id); return $group; @@ -111,7 +115,7 @@ class YammerImporter $content .= ' ' . $upload->shortUrl(); $uploads[] = $upload; } catch (Exception $e) { - common_log(LOG_ERROR, "Error importing Yammer attachment: " . $e->getMessage()); + common_log(LOG_ERR, "Error importing Yammer attachment: " . $e->getMessage()); } } @@ -254,7 +258,8 @@ class YammerImporter $options['local'] = true; return array('orig_id' => $origId, 'orig_url' => $origUrl, - 'options' => $options); + 'options' => $options, + 'avatar' => $avatar); } /** |