]> git.mxchange.org Git - friendica.git/commitdiff
Edits are now possible - but unsuccessful on the receiver side
authorMichael <heluecht@pirati.ca>
Thu, 2 Nov 2017 07:48:41 +0000 (07:48 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 2 Nov 2017 07:48:41 +0000 (07:48 +0000)
include/notifier.php
object/Item.php

index e5ead46e36296e0c74a6cb9c55348c0cb324b8d7..17eb578d18a0b80d485a2e36ea506cf0987f1215 100644 (file)
@@ -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
index c7a1bcabbd43bf70de8415c4c287708c33655627..35421ac3e52209acf34dff5a9cd25250f24a386f 100644 (file)
@@ -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 {