Store the context as a separate field

This commit is contained in:
Michael 2024-07-01 15:05:44 +00:00
parent e3c782010f
commit 03189a1c8c
11 changed files with 97 additions and 12 deletions

View file

@ -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;
}