We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 44dc00a5 authored by mattl's avatar mattl

Non-replies cannot harvest parent notice nicknames

A feature we use of parent notices is that if you use the same @user
as the parent notice, the same @user will be notified, regardless if
there might be @user@site.com as well as @user@example.com and you're
subscribed to just one of them (or both, or none of them!).

But this threw an exception since we tested this on new notice threads.
parent cd23c788
......@@ -710,18 +710,22 @@ function common_find_mentions($text, Notice $notice)
// Is it a reply?
$origNotice = $notice->getParent();
$origAuthor = $origNotice->getProfile();
try {
$origNotice = $notice->getParent();
$origAuthor = $origNotice->getProfile();
$ids = $origNotice->getReplies();
$ids = $origNotice->getReplies();
foreach ($ids as $id) {
try {
$repliedTo = Profile::getByID($id);
$origMentions[$repliedTo->nickname] = $repliedTo;
} catch (NoResultException $e) {
// continue foreach
foreach ($ids as $id) {
try {
$repliedTo = Profile::getByID($id);
$origMentions[$repliedTo->getNickname()] = $repliedTo;
} catch (NoResultException $e) {
// continue foreach
}
}
} catch (NoParentNoticeException $e) {
// It wasn't a reply to anything, so we can't harvest nickname-relations.
}
$matches = common_find_mentions_raw($text);
......
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