From: Michael <heluecht@pirati.ca>
Date: Thu, 2 Nov 2017 07:48:41 +0000 (+0000)
Subject: Edits are now possible - but unsuccessful on the receiver side
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5326b30ad19d1767092c2be14085f8b2a990d434;p=friendica.git

Edits are now possible - but unsuccessful on the receiver side
---

diff --git a/include/notifier.php b/include/notifier.php
index e5ead46e36..17eb578d18 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 c7a1bcabbd..35421ac3e5 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 {