use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
+use Friendica\Model\APContact;
use Friendica\Model\Attach;
use Friendica\Model\Contact;
use Friendica\Model\Conversation;
// we tagged a forum in a top level post. Now we change the post
$private = $private_forum;
- $str_group_allow = '';
- $str_contact_deny = '';
- $str_group_deny = '';
- if ($private_forum) {
- $str_contact_allow = '<' . $private_id . '>';
- } else {
- $str_contact_allow = '';
+ if ($only_to_forum) {
+ $postopts = '';
+ }
+
+ if ($private_forum || !APContact::getByURL($forum_contact['url'])) {
+ $str_group_allow = '';
+ $str_contact_deny = '';
+ $str_group_deny = '';
+ if ($private_forum) {
+ $str_contact_allow = '<' . $private_id . '>';
+ } else {
+ $str_contact_allow = '';
+ }
+ $contact_id = $private_id;
+ $contact_record = $forum_contact;
+ $_REQUEST['origin'] = false;
+ $wall = 0;
}
- $contact_id = $private_id;
- $contact_record = $forum_contact;
- $_REQUEST['origin'] = false;
- $wall = 0;
}
/*
}
// Create Diaspora signature
- if ($item['origin'] && empty($item['diaspora_signed_text'])) {
+ if ($item['origin'] && empty($item['diaspora_signed_text']) && ($item['gravity'] != GRAVITY_PARENT)) {
$signed = Diaspora::createCommentSignature($uid, $item);
if (!empty($signed)) {
$item['diaspora_signed_text'] = json_encode($signed);
Logger::info('The resharer is no forum: quit', ['resharer' => $item['author-id'], 'owner' => $parent['owner-id'], 'author' => $parent['author-id'], 'uid' => $item['uid']]);
return;
}
- self::update(['post-reason' => self::PR_ANNOUNCEMENT, 'causer-id' => $item['author-id']], ['id' => $parent['id']]);
- Logger::info('Set announcement post-reason', ['uri-id' => $item['uri-id'], 'thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid']]);
- return;
}
- self::update(['owner-id' => $item['author-id'], 'contact-id' => $cid], ['id' => $parent['id']]);
- Logger::info('Change owner of the parent', ['uri-id' => $item['uri-id'], 'thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid'], 'owner-id' => $item['author-id'], 'contact-id' => $cid]);
+ self::update(['post-reason' => self::PR_ANNOUNCEMENT, 'causer-id' => $item['author-id']], ['id' => $parent['id']]);
+ Logger::info('Set announcement post-reason', ['uri-id' => $item['uri-id'], 'thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid']]);
}
/**