git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 2af9de4f authored by mmn's avatar mmn

Minor fixes in Linkback plugin

parent b530d385
......@@ -79,11 +79,17 @@ class LinkbackPlugin extends Plugin
$repeat = Notice::getByID($notice->repeat_of);
$this->linkbackUrl($repeat->getUrl());
} else if(!empty($notice->reply_to)) {
$parent = $notice->getParent();
$this->linkbackUrl($parent->getUrl());
try {
$parent = $notice->getParent();
$this->linkbackUrl($parent->getUrl());
} catch (NoParentNoticeException $e) {
// can't link back to what we don't know (apparently parent notice disappeared from our db)
return true;
}
}
$replyProfiles = Profile::multiGet('id', $notice->getReplies());
// doubling up getReplies and getAttentionProfileIDs because we're not entirely migrated yet
$replyProfiles = Profile::multiGet('id', array_unique(array_merge($notice->getReplies(), $notice->getAttentionProfileIDs())));
foreach($replyProfiles->fetchAll('profileurl') as $profileurl) {
$this->linkbackUrl($profileurl);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment