summaryrefslogtreecommitdiff
path: root/actions/finishremotesubscribe.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-06-05 15:37:08 -0400
committerEvan Prodromou <evan@prodromou.name>2008-06-05 15:37:08 -0400
commit56021d95721c06b618dac6272e58d22a3e87037f (patch)
treef232f32b5f7e78f80704c76b1ec6e5d4fd633893 /actions/finishremotesubscribe.php
parentdcc915bd9305349ba6c1a0a716481de0806f5ecf (diff)
move avatar scaling and saving to Avatar and Profile
Extracted the code for setting a new original avatar to the Profile class, and moved some of it to Avatar, too. This makes it easier to have the same functionality whether an avatar is set using the profile settings (for our users), or on a remote subscription. Necessitated changing the filenaming function to just take an ID. darcs-hash:20080605193708-84dde-a441cc0474951ce7f1a1da9310b5145c0b7c3070.gz
Diffstat (limited to 'actions/finishremotesubscribe.php')
-rw-r--r--actions/finishremotesubscribe.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php
index 41bc91afd..fa9aa539f 100644
--- a/actions/finishremotesubscribe.php
+++ b/actions/finishremotesubscribe.php
@@ -140,7 +140,7 @@ class FinishremotesubscribeAction extends Action {
}
if ($avatar_url) {
- $this->add_avatar($avatar_url);
+ $this->add_avatar($profile, $avatar_url);
}
$remote->postnoticeurl = $omb[OMB_ENDPOINT_POSTNOTICE];
@@ -175,6 +175,12 @@ class FinishremotesubscribeAction extends Action {
$user->nickname)));
}
+ function add_avatar($profile, $url) {
+ $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
+ copy($url, $temp_filename);
+ return $profile->setOriginal($temp_filename);
+ }
+
function access_token($omb) {
$con = omb_oauth_consumer();