diff --git a/include/notifier.php b/include/notifier.php index e5ead46e3..17eb578d1 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -285,6 +285,25 @@ function notifier_run(&$argv, &$argc){ if ($parent['origin']) { $relay_to_owner = false; } + + // Special treatment for forum posts + if (($target_item['author-link'] != $target_item['owner-link']) && + ($owner['id'] != $target_item['contact-id']) && + ($target_item['uri'] === $target_item['parent-uri'])) { + + $fields = array('forum', 'prv'); + $condition = array('id' => $target_item['contact-id']); + $contact = dba::select('contact', $fields, $condition, array('limit' => 1)); + if (!dbm::is_result($contact)) { + // Should never happen + return false; + } + + // Is the post from a forum? + if ($contact['forum'] || $contact['prv']) { + $relay_to_owner = true; + } + } if ($relay_to_owner) { logger('notifier: followup '.$target_item["guid"], LOGGER_DEBUG); // local followup to remote post diff --git a/object/Item.php b/object/Item.php index c7a1bcabb..35421ac3e 100644 --- a/object/Item.php +++ b/object/Item.php @@ -128,8 +128,7 @@ class Item extends BaseObject { : false); $shareable = ((($conv->get_profile_owner() == local_user()) && ($item['private'] != 1)) ? true : false); - /// @todo The check for the contact-id is here to block editing of rewritten forum posts - see function dfrn::rewriteDedicatedForumPost - if (local_user() && link_compare($a->contact['url'],$item['author-link']) && ($a->contact['id'] == $item['contact-id'])) { + if (local_user() && link_compare($a->contact['url'],$item['author-link'])) { if ($item["event-id"] != 0) { $edpost = array("events/event/".$item['event-id'], t("Edit")); } else {