summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-17 01:52:57 +0000
committerBrion Vibber <brion@pobox.com>2010-02-17 01:52:57 +0000
commit19b03ef797190076b726ae25842bc3ed502ebef6 (patch)
tree0ceaef70cf82d122ec98c9c274385c68101a7a30
parent454d0b5738a1b79510b998b6da6d0df129a182ab (diff)
parentb2a502b33616cdcbf23a8bccd32f75d17c95a713 (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
-rw-r--r--EVENTS.txt5
-rw-r--r--classes/Notice.php2
-rw-r--r--classes/Profile.php21
3 files changed, 20 insertions, 8 deletions
diff --git a/EVENTS.txt b/EVENTS.txt
index 69fe2ddcc..f333c5442 100644
--- a/EVENTS.txt
+++ b/EVENTS.txt
@@ -1,4 +1,4 @@
-\InitializePlugin: a chance to initialize a plugin in a complete environment
+InitializePlugin: a chance to initialize a plugin in a complete environment
CleanupPlugin: a chance to cleanup a plugin at the end of a program
@@ -722,3 +722,6 @@ StartRobotsTxt: Before outputting the robots.txt page
EndRobotsTxt: After the default robots.txt page (good place for customization)
- &$action: RobotstxtAction being shown
+GetProfileUri: When determining the canonical URI for a given profile
+- &$profile: the current profile
+
diff --git a/classes/Notice.php b/classes/Notice.php
index 73b22d58a..f184b9c52 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1036,7 +1036,7 @@ class Notice extends Memcached_DataObject
$xs->element(
'link', array(
'rel' => 'ostatus:attention',
- 'href' => $profile->getAcctUri()
+ 'href' => $profile->getUri()
)
);
}
diff --git a/classes/Profile.php b/classes/Profile.php
index 8f578c95a..5a86619fd 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -810,10 +810,7 @@ class Profile extends Memcached_DataObject
$xs->element(
'id',
null,
- common_local_url(
- 'userbyid',
- array('id' => $this->id)
- )
+ $this->getUri()
);
$xs->element('title', null, $this->getBestName());
@@ -835,9 +832,21 @@ class Profile extends Memcached_DataObject
return $xs->getString();
}
- function getAcctUri()
+ function getUri()
{
- return $this->nickname . '@' . common_config('site', 'server');
+ if (Event::handle('GetProfileUri', array($this))) {
+
+ $remote = Remote_profile::staticGet('id', $this->id);
+
+ if (!empty($remote)) {
+ return $remote->uri;
+ } else {
+ return common_local_url(
+ 'userbyid',
+ array('id' => $this->id)
+ );
+ }
+ }
}
}