summaryrefslogtreecommitdiff
path: root/classes/Profile.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-08-03 15:50:21 -0700
committerEvan Prodromou <evan@status.net>2010-08-03 15:50:21 -0700
commitf83171824f835ff9cd24bf0aea26f13c62b806cf (patch)
treef66e01184387b1afa454794f4ad6af318ef3759d /classes/Profile.php
parent744233c6dc385a5870652ab70e7141e75aaff783 (diff)
correctly show <source> for atom feeds
Diffstat (limited to 'classes/Profile.php')
-rw-r--r--classes/Profile.php29
1 files changed, 22 insertions, 7 deletions
diff --git a/classes/Profile.php b/classes/Profile.php
index a303469e9..abd6eb031 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -152,17 +152,16 @@ class Profile extends Memcached_DataObject
*
* @return mixed Notice or null
*/
+
function getCurrentNotice()
{
- $notice = new Notice();
- $notice->profile_id = $this->id;
- // @fixme change this to sort on notice.id only when indexes are updated
- $notice->orderBy('created DESC, notice.id DESC');
- $notice->limit(1);
- if ($notice->find(true)) {
+ $notice = $this->getNotices(0, 1);
+
+ if ($notice->fetch()) {
return $notice;
+ } else {
+ return null;
}
- return null;
}
function getTaggedNotices($tag, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
@@ -943,4 +942,20 @@ class Profile extends Memcached_DataObject
return $result;
}
+
+ function getAtomFeed()
+ {
+ $feed = null;
+
+ if (Event::handle('StartProfileGetAtomFeed', array($this, &$feed))) {
+ $user = User::staticGet('id', $this->id);
+ if (!empty($user)) {
+ $feed = common_local_url('ApiTimelineUser', array('id' => $user->id,
+ 'format' => 'atom'));
+ }
+ Event::handle('EndProfileGetAtomFeed', array($this, $feed));
+ }
+
+ return $feed;
+ }
}