Merge pull request #12540 from annando/forum-thread
Improved handling of forum mentions
This commit is contained in:
commit
89705afa9d
1 changed files with 8 additions and 3 deletions
|
@ -674,6 +674,7 @@ class Transmitter
|
||||||
}
|
}
|
||||||
|
|
||||||
$exclusive = false;
|
$exclusive = false;
|
||||||
|
$mention = false;
|
||||||
|
|
||||||
if ($is_forum_thread) {
|
if ($is_forum_thread) {
|
||||||
foreach (Tag::getByURIId($item['parent-uri-id'], [Tag::MENTION, Tag::EXCLUSIVE_MENTION]) as $term) {
|
foreach (Tag::getByURIId($item['parent-uri-id'], [Tag::MENTION, Tag::EXCLUSIVE_MENTION]) as $term) {
|
||||||
|
@ -682,7 +683,7 @@ class Transmitter
|
||||||
if ($term['type'] == Tag::EXCLUSIVE_MENTION) {
|
if ($term['type'] == Tag::EXCLUSIVE_MENTION) {
|
||||||
$exclusive = true;
|
$exclusive = true;
|
||||||
} elseif ($term['type'] == Tag::MENTION) {
|
} elseif ($term['type'] == Tag::MENTION) {
|
||||||
$exclusive = false;
|
$mention = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -718,7 +719,7 @@ class Transmitter
|
||||||
$data['cc'][] = $profile['followers'];
|
$data['cc'][] = $profile['followers'];
|
||||||
}
|
}
|
||||||
} elseif (($term['type'] == Tag::MENTION) && ($profile['type'] == 'Group')) {
|
} elseif (($term['type'] == Tag::MENTION) && ($profile['type'] == 'Group')) {
|
||||||
$exclusive = false;
|
$mention = true;
|
||||||
}
|
}
|
||||||
$data['to'][] = $profile['url'];
|
$data['to'][] = $profile['url'];
|
||||||
}
|
}
|
||||||
|
@ -742,13 +743,17 @@ class Transmitter
|
||||||
$data['cc'][] = $profile['followers'];
|
$data['cc'][] = $profile['followers'];
|
||||||
}
|
}
|
||||||
} elseif (($term['type'] == Tag::MENTION) && ($profile['type'] == 'Group')) {
|
} elseif (($term['type'] == Tag::MENTION) && ($profile['type'] == 'Group')) {
|
||||||
$exclusive = false;
|
$mention = true;
|
||||||
}
|
}
|
||||||
$data['to'][] = $profile['url'];
|
$data['to'][] = $profile['url'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($mention) {
|
||||||
|
$exclusive = false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($is_forum && !$exclusive && !empty($follower)) {
|
if ($is_forum && !$exclusive && !empty($follower)) {
|
||||||
$data['cc'][] = $follower;
|
$data['cc'][] = $follower;
|
||||||
} elseif (!$exclusive) {
|
} elseif (!$exclusive) {
|
||||||
|
|
Loading…
Reference in a new issue