Store "audience" and "attributedTo" data

This commit is contained in:
Michael 2023-04-14 17:21:20 +00:00
parent a36e53af3c
commit 78b969cb19
8 changed files with 90 additions and 57 deletions

View file

@ -79,6 +79,7 @@ class Item
const PR_DISTRIBUTE = 79;
const PR_PUSHED = 80;
const PR_LOCAL = 81;
const PR_AUDIENCE = 82;
// system.accept_only_sharer setting values
const COMPLETION_NONE = 1;
@ -1624,7 +1625,7 @@ class Item
if (($uid != 0) && (($item['gravity'] == self::GRAVITY_PARENT) || $is_reshare) &&
DI::pConfig()->get($uid, 'system', 'accept_only_sharer') == self::COMPLETION_NONE &&
!in_array($item['post-reason'], [self::PR_FOLLOWER, self::PR_TAG, self::PR_TO, self::PR_CC, self::PR_ACTIVITY])) {
!in_array($item['post-reason'], [self::PR_FOLLOWER, self::PR_TAG, self::PR_TO, self::PR_CC, self::PR_ACTIVITY, self::PR_AUDIENCE])) {
Logger::info('Contact is not a follower, thread will not be stored', ['author' => $item['author-link'], 'uid' => $uid, 'uri-id' => $uri_id, 'post-reason' => $item['post-reason']]);
return 0;
}

View file

@ -54,10 +54,12 @@ class Tag
*/
const EXCLUSIVE_MENTION = 9;
const TO = 10;
const CC = 11;
const BTO = 12;
const BCC = 13;
const TO = 10;
const CC = 11;
const BTO = 12;
const BCC = 13;
const AUDIENCE = 14;
const ATTRIBUTED = 15;
const ACCOUNT = 1;
const GENERAL_COLLECTION = 2;
@ -103,7 +105,7 @@ class Tag
$cid = 0;
$tagid = 0;
if (in_array($type, [self::MENTION, self::EXCLUSIVE_MENTION, self::IMPLICIT_MENTION, self::TO, self::CC, self::BTO, self::BCC])) {
if (in_array($type, [self::MENTION, self::EXCLUSIVE_MENTION, self::IMPLICIT_MENTION, self::TO, self::CC, self::BTO, self::BCC, self::AUDIENCE, self::ATTRIBUTED])) {
if (empty($url)) {
// No mention without a contact url
return;
@ -130,7 +132,7 @@ class Tag
}
if (empty($cid)) {
if (!in_array($type, [self::TO, self::CC, self::BTO, self::BCC])) {
if (!in_array($type, [self::TO, self::CC, self::BTO, self::BCC, self::AUDIENCE, self::ATTRIBUTED])) {
if (($type != self::HASHTAG) && !empty($url) && ($url != $name)) {
$url = strtolower($url);
} else {