OStatus fix: include feed profile at notice text processing time, fixes replies
This commit is contained in:
parent
71151b2583
commit
20714d1f35
@ -356,7 +356,6 @@ class Feedinfo extends Memcached_DataObject
|
|||||||
// @fixme this might sort in wrong order if we get multiple updates
|
// @fixme this might sort in wrong order if we get multiple updates
|
||||||
|
|
||||||
$notice = $munger->notice($index);
|
$notice = $munger->notice($index);
|
||||||
$notice->profile_id = $this->profile_id;
|
|
||||||
|
|
||||||
// Double-check for oldies
|
// Double-check for oldies
|
||||||
// @fixme this could explode horribly for multiple feeds on a blog. sigh
|
// @fixme this could explode horribly for multiple feeds on a blog. sigh
|
||||||
@ -368,7 +367,7 @@ class Feedinfo extends Memcached_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @fixme need to ensure that groups get handled correctly
|
// @fixme need to ensure that groups get handled correctly
|
||||||
$saved = Notice::saveNew($this->profile_id,
|
$saved = Notice::saveNew($notice->profile_id,
|
||||||
$notice->content,
|
$notice->content,
|
||||||
'ostatus',
|
'ostatus',
|
||||||
array('is_local' => Notice::REMOTE_OMB,
|
array('is_local' => Notice::REMOTE_OMB,
|
||||||
|
@ -154,6 +154,11 @@ class FeedMunger
|
|||||||
{
|
{
|
||||||
return $this->getAtomLink($this->feed, array('rel' => 'hub'));
|
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.
|
* Get an appropriate avatar image source URL, if available.
|
||||||
@ -209,6 +214,7 @@ class FeedMunger
|
|||||||
$notice->id = -1;
|
$notice->id = -1;
|
||||||
} else {
|
} else {
|
||||||
$notice = new Notice();
|
$notice = new Notice();
|
||||||
|
$notice->profile_id = $this->profileIdForEntry($index);
|
||||||
}
|
}
|
||||||
|
|
||||||
$link = $this->getAltLink($entry);
|
$link = $this->getAltLink($entry);
|
||||||
@ -239,6 +245,20 @@ class FeedMunger
|
|||||||
return $notice;
|
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
|
* @param feed item $entry
|
||||||
* @return mixed Location or false
|
* @return mixed Location or false
|
||||||
|
Loading…
Reference in New Issue
Block a user