Fix for delivering forum posts again

This commit is contained in:
Michael 2018-11-01 23:52:06 +00:00
parent 4f76d21e02
commit 1b43d459b6
2 changed files with 11 additions and 5 deletions

View file

@ -839,6 +839,12 @@ function item_post(App $a) {
// We don't fork a new process since this is done anyway with the following command // We don't fork a new process since this is done anyway with the following command
Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], "CreateShadowEntry", $post_id); Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], "CreateShadowEntry", $post_id);
// When we are doing some forum posting via ! we have to start the notifier manually.
// These kind of posts don't initiate the notifier call in the item class.
if ($only_to_forum) {
Worker::add(PRIORITY_HIGH, "Notifier", $notify_type, $post_id);
}
Logger::log('post_complete'); Logger::log('post_complete');
if ($api_source) { if ($api_source) {

View file

@ -86,7 +86,7 @@ class Term
$tags_string = ''; $tags_string = '';
foreach ($taglist as $tag) { foreach ($taglist as $tag) {
if ((substr(trim($tag), 0, 1) == '#') || (substr(trim($tag), 0, 1) == '@')) { if ((substr(trim($tag), 0, 1) == '#') || (substr(trim($tag), 0, 1) == '@') || (substr(trim($tag), 0, 1) == '!')) {
$tags_string .= ' ' . trim($tag); $tags_string .= ' ' . trim($tag);
} else { } else {
$tags_string .= ' #' . trim($tag); $tags_string .= ' #' . trim($tag);
@ -107,11 +107,11 @@ class Term
} }
} }
$pattern = '/\W([\#@])\[url\=(.*?)\](.*?)\[\/url\]/ism'; $pattern = '/\W([\#@!])\[url\=(.*?)\](.*?)\[\/url\]/ism';
if (preg_match_all($pattern, $data, $matches, PREG_SET_ORDER)) { if (preg_match_all($pattern, $data, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) { foreach ($matches as $match) {
if ($match[1] == '@') { if (($match[1] == '@') || ($match[1] == '!')) {
$contact = Contact::getDetailsByURL($match[2], 0); $contact = Contact::getDetailsByURL($match[2], 0);
if (!empty($contact['addr'])) { if (!empty($contact['addr'])) {
$match[3] = $contact['addr']; $match[3] = $contact['addr'];
@ -140,7 +140,7 @@ class Term
$type = TERM_HASHTAG; $type = TERM_HASHTAG;
$term = substr($tag, 1); $term = substr($tag, 1);
} elseif (substr(trim($tag), 0, 1) == '@') { } elseif ((substr(trim($tag), 0, 1) == '@') || (substr(trim($tag), 0, 1) == '!')) {
$type = TERM_MENTION; $type = TERM_MENTION;
$contact = Contact::getDetailsByURL($link, 0); $contact = Contact::getDetailsByURL($link, 0);
@ -179,7 +179,7 @@ class Term
]); ]);
// Search for mentions // Search for mentions
if ((substr($tag, 0, 1) == '@') && (strpos($link, $profile_base_friendica) || strpos($link, $profile_base_diaspora))) { if (((substr($tag, 0, 1) == '@') || (substr($tag, 0, 1) == '!')) && (strpos($link, $profile_base_friendica) || strpos($link, $profile_base_diaspora))) {
$users = q("SELECT `uid` FROM `contact` WHERE self AND (`url` = '%s' OR `nurl` = '%s')", $link, $link); $users = q("SELECT `uid` FROM `contact` WHERE self AND (`url` = '%s' OR `nurl` = '%s')", $link, $link);
foreach ($users AS $user) { foreach ($users AS $user) {
if ($user['uid'] == $message['uid']) { if ($user['uid'] == $message['uid']) {