Compare commits
No commits in common. "aeefb929263adf74ebce77c5fac25af81e033395" and "f499875f5b4bc00b4dc1d44c91a75992c17b14bc" have entirely different histories.
aeefb92926
...
f499875f5b
12 changed files with 157 additions and 135 deletions
|
@ -587,13 +587,13 @@ function bluesky_hook_fork(array &$b)
|
|||
|
||||
if (DI::pConfig()->get($post['uid'], 'bluesky', 'import')) {
|
||||
// Don't post if it isn't a reply to a bluesky post
|
||||
if (($post['gravity'] != Item::GRAVITY_PARENT) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::BLUESKY])) {
|
||||
if (($post['parent'] != $post['id']) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::BLUESKY])) {
|
||||
Logger::notice('No bluesky parent found', ['item' => $post['id']]);
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
} elseif (!strstr($post['postopts'] ?? '', 'bluesky') || ($post['gravity'] != Item::GRAVITY_PARENT) || ($post['private'] == Item::PRIVATE)) {
|
||||
DI::logger()->info('Post will not be exported', ['uid' => $post['uid'], 'postopts' => $post['postopts'], 'gravity' => $post['gravity'], 'private' => $post['private']]);
|
||||
} elseif (!strstr($post['postopts'] ?? '', 'bluesky') || ($post['parent'] != $post['id']) || $post['private']) {
|
||||
DI::logger()->info('Activities are never exported when we don\'t import the bluesky timeline', ['uid' => $post['uid']]);
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
|
@ -601,11 +601,15 @@ function bluesky_hook_fork(array &$b)
|
|||
|
||||
function bluesky_post_local(array &$b)
|
||||
{
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
if ($b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -663,7 +667,7 @@ function bluesky_send(array &$b)
|
|||
bluesky_create_activity($b, $parent);
|
||||
}
|
||||
return;
|
||||
} elseif (($b['private'] == Item::PRIVATE) || !strstr($b['postopts'], 'bluesky')) {
|
||||
} elseif ($b['private'] || !strstr($b['postopts'], 'bluesky')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1477,18 +1481,6 @@ function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $le
|
|||
|
||||
case 'app.bsky.embed.record#view':
|
||||
$original_uri = $uri = bluesky_get_uri($embed->record);
|
||||
$type = '$type';
|
||||
if (!empty($embed->record->record->$type)) {
|
||||
$embed_type = $embed->record->record->$type;
|
||||
if ($embed_type == 'app.bsky.graph.starterpack') {
|
||||
Logger::debug('Starterpacks are not fetched like posts', ['original-uri' => $original_uri]);
|
||||
if (empty($item['body'])) {
|
||||
// @todo process starterpack
|
||||
$item['body'] = '[url=' . $embed->record->record->list . ']' . $embed->record->record->name . '[/url]';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
$uri = bluesky_fetch_missing_post($uri, $item['uid'], $fetch_uid, Item::PR_FETCHED, $item['contact-id'], $level, $last_poll);
|
||||
if ($uri) {
|
||||
$shared = Post::selectFirst(['uri-id'], ['uri' => $uri, 'uid' => [$item['uid'], 0]]);
|
||||
|
|
|
@ -17,7 +17,6 @@ use Friendica\Core\Renderer;
|
|||
use Friendica\Database\DBA;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Post;
|
||||
|
||||
function diaspora_install()
|
||||
|
@ -145,10 +144,8 @@ function diaspora_hook_fork(array &$b)
|
|||
|
||||
$post = $b['data'];
|
||||
|
||||
if (
|
||||
$post['deleted'] || ($post['private'] == Item::PRIVATE) || ($post['created'] !== $post['edited']) ||
|
||||
!strstr($post['postopts'] ?? '', 'diaspora') || ($post['gravity'] != Item::GRAVITY_PARENT)
|
||||
) {
|
||||
if ($post['deleted'] || $post['private'] || ($post['created'] !== $post['edited']) ||
|
||||
!strstr($post['postopts'] ?? '', 'diaspora') || ($post['parent'] != $post['id'])) {
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
|
@ -156,11 +153,15 @@ function diaspora_hook_fork(array &$b)
|
|||
|
||||
function diaspora_post_local(array &$b)
|
||||
{
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
if ($b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -189,7 +190,7 @@ function diaspora_send(array &$b)
|
|||
|
||||
Logger::notice('diaspora_send: invoked');
|
||||
|
||||
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
||||
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ use Friendica\Core\Hook;
|
|||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Post;
|
||||
use Friendica\Model\Tag;
|
||||
use Friendica\Model\User;
|
||||
|
@ -89,12 +88,16 @@ function dwpost_settings_post(array &$b)
|
|||
|
||||
function dwpost_post_local(array &$b)
|
||||
{
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((!DI::userSession()->getLocalUserId()) || (DI::userSession()->getLocalUserId() != $b['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
if ($b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -119,7 +122,7 @@ function dwpost_post_local(array &$b)
|
|||
|
||||
function dwpost_send(array &$b)
|
||||
{
|
||||
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
||||
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ use Friendica\Core\Hook;
|
|||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Tag;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
@ -86,12 +85,17 @@ function ijpost_settings_post(array &$b)
|
|||
|
||||
function ijpost_post_local(array &$b)
|
||||
{
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
if ($b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -116,7 +120,7 @@ function ijpost_post_local(array &$b)
|
|||
|
||||
function ijpost_send(array &$b)
|
||||
{
|
||||
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
||||
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ use Friendica\Core\Logger;
|
|||
use Friendica\Core\Renderer;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Post;
|
||||
|
||||
function libertree_install()
|
||||
|
@ -79,7 +78,9 @@ function libertree_settings_post(array &$b)
|
|||
DI::pConfig()->set(DI::userSession()->getLocalUserId(),'libertree','post_by_default',intval($_POST['libertree_bydefault']));
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(),'libertree','libertree_api_token',trim($_POST['libertree_api_token']));
|
||||
DI::pConfig()->set(DI::userSession()->getLocalUserId(),'libertree','libertree_url',trim($_POST['libertree_url']));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function libertree_hook_fork(array &$b)
|
||||
|
@ -90,10 +91,8 @@ function libertree_hook_fork(array &$b)
|
|||
|
||||
$post = $b['data'];
|
||||
|
||||
if (
|
||||
$post['deleted'] || ($post['private'] == Item::PRIVATE) || ($post['created'] !== $post['edited']) ||
|
||||
!strstr($post['postopts'], 'libertree') || ($post['gravity'] != Item::GRAVITY_PARENT)
|
||||
) {
|
||||
if ($post['deleted'] || $post['private'] || ($post['created'] !== $post['edited']) ||
|
||||
!strstr($post['postopts'], 'libertree') || ($post['parent'] != $post['id'])) {
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
|
@ -101,12 +100,18 @@ function libertree_hook_fork(array &$b)
|
|||
|
||||
function libertree_post_local(array &$b)
|
||||
{
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
if ($b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -133,7 +138,7 @@ function libertree_send(array &$b)
|
|||
{
|
||||
Logger::notice('libertree_send: invoked');
|
||||
|
||||
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
||||
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ use Friendica\Core\Hook;
|
|||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Post;
|
||||
use Friendica\Model\Tag;
|
||||
use Friendica\Model\User;
|
||||
|
@ -87,12 +86,16 @@ function ljpost_settings_post(array &$b)
|
|||
|
||||
function ljpost_post_local(array &$b)
|
||||
{
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
if ($b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -115,7 +118,7 @@ function ljpost_post_local(array &$b)
|
|||
|
||||
function ljpost_send(array &$b)
|
||||
{
|
||||
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
||||
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ use Friendica\Core\Logger;
|
|||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Photo;
|
||||
use phpnut\phpnutException;
|
||||
|
||||
|
@ -222,7 +221,7 @@ function pnut_hook_fork(array &$b)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!strstr($post['postopts'] ?? '', 'pnut') || ($post['gravity'] != Item::GRAVITY_PARENT) || ($post['private'] == Item::PRIVATE)) {
|
||||
if (!strstr($post['postopts'] ?? '', 'pnut') || ($post['parent'] != $post['id']) || $post['private']) {
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
|
@ -230,11 +229,15 @@ function pnut_hook_fork(array &$b)
|
|||
|
||||
function pnut_post_local(array &$b)
|
||||
{
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
if ($b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -262,7 +265,7 @@ function pnut_post_hook(array &$b)
|
|||
/**
|
||||
* Post to pnut.io
|
||||
*/
|
||||
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
||||
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -345,14 +345,14 @@ function pumpio_hook_fork(array &$b)
|
|||
|
||||
if (DI::pConfig()->get($post['uid'], 'pumpio', 'import')) {
|
||||
// Don't fork if it isn't a reply to a pump.io post
|
||||
if (($post['gravity'] != Item::GRAVITY_PARENT) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::PUMPIO])) {
|
||||
if (($post['parent'] != $post['id']) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::PUMPIO])) {
|
||||
Logger::notice('No pump.io parent found for item ' . $post['id']);
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Comments are never exported when we don't import the pumpio timeline
|
||||
if (!strstr($post['postopts'], 'pumpio') || ($post['gravity'] != Item::GRAVITY_PARENT)|| ($post['private'] == Item::PRIVATE)) {
|
||||
if (!strstr($post['postopts'], 'pumpio') || ($post['parent'] != $post['id']) || $post['private']) {
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ function pumpio_send(array &$b)
|
|||
|
||||
Logger::notice('pumpio_send: receiver ', $receiver);
|
||||
|
||||
if (!count($receiver) && ($b['private'] == Item::PRIVATE) || !strstr($b['postopts'], 'pumpio'))) {
|
||||
if (!count($receiver) && ($b['private'] || !strstr($b['postopts'], 'pumpio'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1319,7 +1319,7 @@ function pumpio_getreceiver(array $b)
|
|||
{
|
||||
$receiver = [];
|
||||
|
||||
if ($b['private'] != Item::PRIVATE)) {
|
||||
if (!$b['private']) {
|
||||
if (!strstr($b['postopts'], 'pumpio')) {
|
||||
return $receiver;
|
||||
}
|
||||
|
|
|
@ -296,7 +296,7 @@ function statusnet_hook_fork(array &$b)
|
|||
|
||||
$post = $b['data'];
|
||||
|
||||
if ($post['deleted'] || ($post['created'] !== $post['edited']) || strpos($post['postopts'] ?? '', 'statusnet') === false || ($post['gravity'] != Item::GRAVITY_PARENT) || ($post['private'] == Item::PRIVATE)) {
|
||||
if ($post['deleted'] || ($post['created'] !== $post['edited']) || strpos($post['postopts'] ?? '', 'statusnet') === false || ($post['parent'] != $post['id']) || $post['private']) {
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ function statusnet_post_hook(array &$b)
|
|||
/**
|
||||
* Post to GNU Social
|
||||
*/
|
||||
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
||||
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -439,13 +439,11 @@ function statusnet_addon_admin_post()
|
|||
$secret = trim($_POST['secret'][$id]);
|
||||
$key = trim($_POST['key'][$id]);
|
||||
//$applicationname = (!empty($_POST['applicationname']) ? Strings::escapeTags(trim($_POST['applicationname'][$id])):'');
|
||||
if (
|
||||
$sitename != '' &&
|
||||
if ($sitename != '' &&
|
||||
$apiurl != '' &&
|
||||
$secret != '' &&
|
||||
$key != '' &&
|
||||
empty($_POST['delete'][$id])
|
||||
) {
|
||||
empty($_POST['delete'][$id])) {
|
||||
|
||||
$sites[] = [
|
||||
'sitename' => $sitename,
|
||||
|
|
|
@ -477,13 +477,13 @@ function tumblr_hook_fork(array &$b)
|
|||
|
||||
if (DI::pConfig()->get($post['uid'], 'tumblr', 'import')) {
|
||||
// Don't post if it isn't a reply to a tumblr post
|
||||
if (($post['gravity'] != Item::GRAVITY_PARENT) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::TUMBLR])) {
|
||||
if (($post['parent'] != $post['id']) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::TUMBLR])) {
|
||||
Logger::notice('No tumblr parent found', ['item' => $post['id']]);
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
} elseif (!strstr($post['postopts'] ?? '', 'tumblr') || ($post['gravity'] != Item::GRAVITY_PARENT) || ($post['private'] == Item::PRIVATE)) {
|
||||
DI::logger()->info('Post will not be exported', ['uid' => $post['uid'], 'postopts' => $post['postopts'], 'gravity' => $post['gravity'], 'private' => $post['private']]);
|
||||
} elseif (!strstr($post['postopts'] ?? '', 'tumblr') || ($post['parent'] != $post['id']) || $post['private']) {
|
||||
DI::logger()->info('Activities are never exported when we don\'t import the tumblr timeline', ['uid' => $post['uid']]);
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
}
|
||||
|
@ -491,11 +491,15 @@ function tumblr_hook_fork(array &$b)
|
|||
|
||||
function tumblr_post_local(array &$b)
|
||||
{
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
if ($b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -571,7 +575,7 @@ function tumblr_send(array &$b)
|
|||
}
|
||||
}
|
||||
return;
|
||||
} elseif (($b['private'] == Item::PRIVATE) || !strstr($b['postopts'], 'tumblr')) {
|
||||
} elseif ($b['private'] || !strstr($b['postopts'], 'tumblr')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ function twitter_hook_fork(array &$b)
|
|||
$post = $b['data'];
|
||||
|
||||
if (
|
||||
$post['deleted'] || ($post['private'] == Item::PRIVATE) || ($post['created'] !== $post['edited']) ||
|
||||
$post['deleted'] || $post['private'] || ($post['created'] !== $post['edited']) ||
|
||||
!strstr($post['postopts'], 'twitter') || ($post['gravity'] != Item::GRAVITY_PARENT)
|
||||
) {
|
||||
$b['execute'] = false;
|
||||
|
@ -184,7 +184,7 @@ function twitter_post_local(array &$b)
|
|||
return;
|
||||
}
|
||||
|
||||
if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
if ($b['edit'] || $b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ function twitter_post_hook(array &$b)
|
|||
{
|
||||
DI::logger()->debug('Invoke post hook', $b);
|
||||
|
||||
if (($b['gravity'] != Item::GRAVITY_PARENT) || !strstr($b['postopts'], 'twitter') || ($b['private'] == Item::PRIVATE) || $b['deleted'] || ($b['created'] !== $b['edited'])) {
|
||||
if (($b['gravity'] != Item::GRAVITY_PARENT) || !strstr($b['postopts'], 'twitter') || $b['private'] || $b['deleted'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,8 +108,8 @@ function wppost_hook_fork(array &$b)
|
|||
$post = $b['data'];
|
||||
|
||||
if (
|
||||
$post['deleted'] || ($post['private'] == Item::PRIVATE) || ($post['created'] !== $post['edited']) ||
|
||||
!strstr($post['postopts'] ?? '', 'wppost') || ($post['gravity'] != Item::GRAVITY_PARENT)
|
||||
$post['deleted'] || $post['private'] || ($post['created'] !== $post['edited']) ||
|
||||
!strstr($post['postopts'] ?? '', 'wppost') || ($post['parent'] != $post['id'])
|
||||
) {
|
||||
$b['execute'] = false;
|
||||
return;
|
||||
|
@ -118,12 +118,18 @@ function wppost_hook_fork(array &$b)
|
|||
|
||||
function wppost_post_local(array &$b)
|
||||
{
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
|
||||
if ($b['edit']) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DI::userSession()->getLocalUserId() || (DI::userSession()->getLocalUserId() != $b['uid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// This can probably be changed to allow editing by pointing to a different API endpoint
|
||||
if ($b['edit'] || ($b['private'] == Item::PRIVATE) || ($b['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
if ($b['private'] || $b['parent']) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -146,9 +152,12 @@ function wppost_post_local(array &$b)
|
|||
$b['postopts'] .= 'wppost';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function wppost_send(array &$b)
|
||||
{
|
||||
if ($b['deleted'] || ($b['private'] == Item::PRIVATE) || ($b['created'] !== $b['edited'])) {
|
||||
if ($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue