summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-03-05 11:03:42 -0800
committerEvan Prodromou <evan@controlyourself.ca>2009-03-05 11:03:42 -0800
commitb9781258bbfaac0e7fc91af4f77f1f340274a88e (patch)
treea3c42c1b7761ca39a4ef14e9922cfb7b22ca982b
parent00c358956fcece251b8d78f2c6a41098571472c7 (diff)
@-links go to permalinks for local users
-rw-r--r--lib/util.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php
index f9a787d47..167508d2b 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -622,9 +622,15 @@ function common_at_link($sender_id, $nickname)
$sender = Profile::staticGet($sender_id);
$recipient = common_relative_profile($sender, common_canonical_nickname($nickname));
if ($recipient) {
+ $user = User::staticGet('id', $recipient->id);
+ if ($user) {
+ $url = common_local_url('userbyid', array('id' => $user->id));
+ } else {
+ $url = $recipient->profileurl;
+ }
$xs = new XMLStringer(false);
$xs->elementStart('span', 'vcard');
- $xs->elementStart('a', array('href' => $recipient->profileurl,
+ $xs->elementStart('a', array('href' => $url,
'class' => 'url'));
$xs->element('span', 'fn nickname', $nickname);
$xs->elementEnd('a');