summaryrefslogtreecommitdiff
path: root/plugins/OStatus
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-23 11:37:49 -0800
committerBrion Vibber <brion@pobox.com>2010-02-23 11:37:49 -0800
commite070fcaaae3e6ac1fef1f9b066c5335fddb9376b (patch)
tree7e29c909ef631759a2b34b251a95721c93362a34 /plugins/OStatus
parent1bffe424131dfa2c7a85fd9cf782e8c806326bbe (diff)
OStatus: fix for avatars, submit button in updated remote profile preview
Diffstat (limited to 'plugins/OStatus')
-rw-r--r--plugins/OStatus/actions/ostatussub.php42
1 files changed, 25 insertions, 17 deletions
diff --git a/plugins/OStatus/actions/ostatussub.php b/plugins/OStatus/actions/ostatussub.php
index 206fb309d..0d786fac9 100644
--- a/plugins/OStatus/actions/ostatussub.php
+++ b/plugins/OStatus/actions/ostatussub.php
@@ -126,7 +126,13 @@ class OStatusSubAction extends Action
$oprofile = $this->oprofile;
$profile = $oprofile->localProfile();
- $this->showEntity($profile);
+ $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
+ $avatarUrl = $avatar ? $avatar->displayUrl() : false;
+
+ $this->showEntity($profile,
+ $profile->profileurl,
+ $avatarUrl,
+ $profile->bio);
}
/**
@@ -137,31 +143,33 @@ class OStatusSubAction extends Action
$oprofile = $this->oprofile;
$group = $oprofile->localGroup();
- $this->showEntity($group);
+ $this->showEntity($group,
+ $group->getProfileUrl(),
+ $group->homepage_logo,
+ $group->description);
}
- function showEntity($entity)
+ function showEntity($entity, $profile, $avatar, $note)
{
$nickname = $entity->nickname;
- $profile = $entity->profileurl;
$fullname = $entity->fullname;
$homepage = $entity->homepage;
- $bio = $entity->bio;
$location = $entity->location;
- $avatar = $entity->avatarurl;
+
+ if (!$avatar) {
+ $avatar = Avatar::defaultImage(AVATAR_PROFILE_SIZE);
+ }
$this->elementStart('div', 'entity_profile vcard');
$this->elementStart('dl', 'entity_depiction');
$this->element('dt', null, _('Photo'));
$this->elementStart('dd');
- if ($avatar) {
- $this->element('img', array('src' => $avatar,
- 'class' => 'photo avatar',
- 'width' => AVATAR_PROFILE_SIZE,
- 'height' => AVATAR_PROFILE_SIZE,
- 'alt' => $nickname));
- }
+ $this->element('img', array('src' => $avatar,
+ 'class' => 'photo avatar',
+ 'width' => AVATAR_PROFILE_SIZE,
+ 'height' => AVATAR_PROFILE_SIZE,
+ 'alt' => $nickname));
$this->elementEnd('dd');
$this->elementEnd('dl');
@@ -206,11 +214,11 @@ class OStatusSubAction extends Action
$this->elementEnd('dl');
}
- if (!is_null($bio)) {
+ if (!is_null($note)) {
$this->elementStart('dl', 'entity_note');
$this->element('dt', null, _('Note'));
$this->elementStart('dd', 'note');
- $this->raw($bio);
+ $this->raw($note);
$this->elementEnd('dd');
$this->elementEnd('dl');
}
@@ -368,7 +376,7 @@ class OStatusSubAction extends Action
}
if ($this->validateFeed()) {
- if ($this->arg('subscribe')) {
+ if ($this->arg('submit')) {
$this->saveFeed();
return;
}
@@ -424,7 +432,7 @@ class OStatusSubAction extends Action
function showPageNotice()
{
- if ($this->error) {
+ if (!empty($this->error)) {
$this->element('p', 'error', $this->error);
}
}