Fix commenting on public posts
This commit is contained in:
parent
8628bd5228
commit
9191daf12f
2 changed files with 14 additions and 1 deletions
|
@ -659,6 +659,12 @@ class Item
|
||||||
$params = ['order' => ['id' => false]];
|
$params = ['order' => ['id' => false]];
|
||||||
$parent = Post::selectFirst($fields, $condition, $params);
|
$parent = Post::selectFirst($fields, $condition, $params);
|
||||||
|
|
||||||
|
if (!DBA::isResult($parent) && $item['origin']) {
|
||||||
|
$stored = Item::storeForUserByUriId($item['thr-parent-id'], $item['uid']);
|
||||||
|
Logger::info('Stored thread parent item for user', ['uri-id' => $item['thr-parent-id'], 'uid' => $item['uid'], 'stored' => $stored]);
|
||||||
|
$parent = Post::selectFirst($fields, $condition, $params);
|
||||||
|
}
|
||||||
|
|
||||||
if (!DBA::isResult($parent)) {
|
if (!DBA::isResult($parent)) {
|
||||||
Logger::notice('item parent was not found - ignoring item', ['thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid']]);
|
Logger::notice('item parent was not found - ignoring item', ['thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid']]);
|
||||||
return [];
|
return [];
|
||||||
|
@ -673,6 +679,13 @@ class Item
|
||||||
'uid' => $parent['uid']];
|
'uid' => $parent['uid']];
|
||||||
$params = ['order' => ['id' => false]];
|
$params = ['order' => ['id' => false]];
|
||||||
$toplevel_parent = Post::selectFirst($fields, $condition, $params);
|
$toplevel_parent = Post::selectFirst($fields, $condition, $params);
|
||||||
|
|
||||||
|
if (!DBA::isResult($toplevel_parent) && $item['origin']) {
|
||||||
|
$stored = Item::storeForUserByUriId($item['parent-uri-id'], $item['uid']);
|
||||||
|
Logger::info('Stored parent item for user', ['uri-id' => $item['parent-uri-id'], 'uid' => $item['uid'], 'stored' => $stored]);
|
||||||
|
$toplevel_parent = Post::selectFirst($fields, $condition, $params);
|
||||||
|
}
|
||||||
|
|
||||||
if (!DBA::isResult($toplevel_parent)) {
|
if (!DBA::isResult($toplevel_parent)) {
|
||||||
Logger::notice('item top level parent was not found - ignoring item', ['parent-uri-id' => $parent['parent-uri-id'], 'uid' => $parent['uid']]);
|
Logger::notice('item top level parent was not found - ignoring item', ['parent-uri-id' => $parent['parent-uri-id'], 'uid' => $parent['uid']]);
|
||||||
return [];
|
return [];
|
||||||
|
|
|
@ -744,7 +744,7 @@ class Notifier
|
||||||
|
|
||||||
// Also don't deliver when the direct thread parent was delivered via Diaspora
|
// Also don't deliver when the direct thread parent was delivered via Diaspora
|
||||||
if ($thr_parent['network'] == Protocol::DIASPORA) {
|
if ($thr_parent['network'] == Protocol::DIASPORA) {
|
||||||
Logger::info('Threat parent network is Diaspora, so no AP delivery');
|
Logger::info('Thread parent network is Diaspora, so no AP delivery');
|
||||||
return ['count' => 0, 'contacts' => []];
|
return ['count' => 0, 'contacts' => []];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue