mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 09:34:26 +02:00
Store the context as a separate field
This commit is contained in:
parent
e3c782010f
commit
03189a1c8c
11 changed files with 97 additions and 12 deletions
|
@ -320,13 +320,22 @@ class Processor
|
|||
$item['object-type'] = Activity\ObjectType::COMMENT;
|
||||
}
|
||||
|
||||
if (!empty($activity['conversation'])) {
|
||||
$item['conversation'] = $activity['conversation'];
|
||||
} elseif (!empty($activity['context'])) {
|
||||
$item['conversation'] = $activity['context'];
|
||||
if (!empty($activity['context'])) {
|
||||
$item['context'] = $activity['context'];
|
||||
}
|
||||
|
||||
if (!empty($item['conversation'])) {
|
||||
if (!empty($activity['conversation'])) {
|
||||
$item['conversation'] = $activity['conversation'];
|
||||
}
|
||||
|
||||
if (!empty($item['context'])) {
|
||||
$conversation = Post::selectFirstThread(['uri'], ['context' => $item['context']]);
|
||||
if (!empty($conversation)) {
|
||||
Logger::debug('Got context', ['context' => $item['context'], 'parent' => $conversation]);
|
||||
$item['parent-uri'] = $conversation['uri'];
|
||||
$item['parent-uri-id'] = ItemURI::getIdByURI($item['parent-uri']);
|
||||
}
|
||||
} elseif (!empty($item['conversation'])) {
|
||||
$conversation = Post::selectFirstThread(['uri'], ['conversation' => $item['conversation']]);
|
||||
if (!empty($conversation)) {
|
||||
Logger::debug('Got conversation', ['conversation' => $item['conversation'], 'parent' => $conversation]);
|
||||
|
|
|
@ -64,8 +64,10 @@ class Queue
|
|||
}
|
||||
|
||||
if (!empty($activity['context'])) {
|
||||
$fields['conversation'] = $activity['context'];
|
||||
} elseif (!empty($activity['conversation'])) {
|
||||
$fields['context'] = $activity['context'];
|
||||
}
|
||||
|
||||
if (!empty($activity['conversation'])) {
|
||||
$fields['conversation'] = $activity['conversation'];
|
||||
}
|
||||
|
||||
|
@ -296,9 +298,15 @@ class Queue
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!empty($entry['context'])) {
|
||||
if (DBA::exists('post-thread', ['context-id' => ItemURI::getIdByURI($entry['context'], false)])) {
|
||||
// We have got the context in the system, so the post can be processed
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($entry['conversation'])) {
|
||||
$conv_id = ItemURI::getIdByURI($entry['conversation'], false);
|
||||
if (DBA::exists('post-thread', ['conversation-id' => $conv_id])) {
|
||||
if (DBA::exists('post-thread', ['conversation-id' => ItemURI::getIdByURI($entry['conversation'], false)])) {
|
||||
// We have got the conversation in the system, so the post can be processed
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1865,8 +1865,12 @@ class Transmitter
|
|||
}
|
||||
$data['sensitive'] = (bool)$item['sensitive'];
|
||||
|
||||
if (!empty($item['context']) && ($item['context'] != './')) {
|
||||
$data['context'] = $item['context'];
|
||||
}
|
||||
|
||||
if (!empty($item['conversation']) && ($item['conversation'] != './')) {
|
||||
$data['conversation'] = $data['context'] = $item['conversation'];
|
||||
$data['conversation'] = $item['conversation'];
|
||||
}
|
||||
|
||||
if (!empty($title)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue