]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
@-links go to permalinks for local users
authorEvan Prodromou <evan@controlyourself.ca>
Thu, 5 Mar 2009 19:03:42 +0000 (11:03 -0800)
committerEvan Prodromou <evan@controlyourself.ca>
Thu, 5 Mar 2009 19:03:42 +0000 (11:03 -0800)
lib/util.php

index f9a787d473262b52ad9ea5862803c36feda6fc06..167508d2b30bd64de540ac19d7d33c0e2d692583 100644 (file)
@@ -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');