Edits are now possible - but unsuccessful on the receiver side

This commit is contained in:
Michael 2017-11-02 07:48:41 +00:00
parent 01af4435c8
commit 5326b30ad1
2 changed files with 20 additions and 2 deletions

View 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

View 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 {