// @fixme this might sort in wrong order if we get multiple updates
$notice = $munger->notice($index);
- $notice->profile_id = $this->profile_id;
// Double-check for oldies
// @fixme this could explode horribly for multiple feeds on a blog. sigh
}
// @fixme need to ensure that groups get handled correctly
- $saved = Notice::saveNew($this->profile_id,
+ $saved = Notice::saveNew($notice->profile_id,
$notice->content,
'ostatus',
array('is_local' => Notice::REMOTE_OMB,
{
return $this->getAtomLink($this->feed, array('rel' => 'hub'));
}
+
+ function getSelfLink()
+ {
+ return $this->getAtomLink($this->feed, array('rel' => 'self'));
+ }
/**
* Get an appropriate avatar image source URL, if available.
$notice->id = -1;
} else {
$notice = new Notice();
+ $notice->profile_id = $this->profileIdForEntry($index);
}
$link = $this->getAltLink($entry);
return $notice;
}
+ function profileIdForEntry($index=1)
+ {
+ // hack hack hack
+ // should get profile for this entry's author...
+ $feed = new Feedinfo();
+ $feed->feeduri = $self;
+ $feed = Feedinfo::staticGet('feeduri', $this->getSelfLink());
+ if ($feed) {
+ return $feed->profile_id;
+ } else {
+ throw new Exception("Can't find feed profile");
+ }
+ }
+
/**
* @param feed item $entry
* @return mixed Location or false