Merge pull request #12539 from annando/forum-thread

Distribute forum comments only via the forum
This commit is contained in:
Philipp 2022-12-27 17:51:22 +01:00 committed by GitHub
commit e0fa557f18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View file

@ -52,7 +52,6 @@ class Protocol
// Supported through a connector // Supported through a connector
const DIASPORA2 = 'dspc'; // Diaspora connector const DIASPORA2 = 'dspc'; // Diaspora connector
const LINKEDIN = 'lnkd'; // LinkedIn
const PUMPIO = 'pump'; // pump.io const PUMPIO = 'pump'; // pump.io
const STATUSNET = 'stac'; // Statusnet connector const STATUSNET = 'stac'; // Statusnet connector
const TWITTER = 'twit'; // Twitter const TWITTER = 'twit'; // Twitter
@ -66,6 +65,7 @@ class Protocol
// Currently unsupported // Currently unsupported
const ICALENDAR = 'ical'; // iCalendar const ICALENDAR = 'ical'; // iCalendar
const MYSPACE = 'mysp'; // MySpace const MYSPACE = 'mysp'; // MySpace
const LINKEDIN = 'lnkd'; // LinkedIn
const NEWS = 'nntp'; // Network News Transfer Protocol const NEWS = 'nntp'; // Network News Transfer Protocol
const PNUT = 'pnut'; // pnut.io const PNUT = 'pnut'; // pnut.io
const XMPP = 'xmpp'; // XMPP const XMPP = 'xmpp'; // XMPP

View file

@ -675,6 +675,19 @@ class Transmitter
$exclusive = false; $exclusive = false;
if ($is_forum_thread) {
foreach (Tag::getByURIId($item['parent-uri-id'], [Tag::MENTION, Tag::EXCLUSIVE_MENTION]) as $term) {
$profile = APContact::getByURL($term['url'], false);
if (!empty($profile) && ($profile['type'] == 'Group')) {
if ($term['type'] == Tag::EXCLUSIVE_MENTION) {
$exclusive = true;
} elseif ($term['type'] == Tag::MENTION) {
$exclusive = false;
}
}
}
}
$terms = Tag::getByURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]); $terms = Tag::getByURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
if ($item['private'] != Item::PRIVATE) { if ($item['private'] != Item::PRIVATE) {
@ -704,6 +717,8 @@ class Transmitter
if (!empty($profile['followers']) && ($profile['type'] == 'Group')) { if (!empty($profile['followers']) && ($profile['type'] == 'Group')) {
$data['cc'][] = $profile['followers']; $data['cc'][] = $profile['followers'];
} }
} elseif (($term['type'] == Tag::MENTION) && ($profile['type'] == 'Group')) {
$exclusive = false;
} }
$data['to'][] = $profile['url']; $data['to'][] = $profile['url'];
} }
@ -726,6 +741,8 @@ class Transmitter
if (!empty($profile['followers']) && ($profile['type'] == 'Group')) { if (!empty($profile['followers']) && ($profile['type'] == 'Group')) {
$data['cc'][] = $profile['followers']; $data['cc'][] = $profile['followers'];
} }
} elseif (($term['type'] == Tag::MENTION) && ($profile['type'] == 'Group')) {
$exclusive = false;
} }
$data['to'][] = $profile['url']; $data['to'][] = $profile['url'];
} }