+ self::setFailedQueue($cmd, $target_id);
+ return;
+ }
+
+ $condition = ['uri' => $target_item['thr-parent'], 'uid' => $target_item['uid']];
+ $thr_parent = Model\Item::selectFirst(['network', 'object'], $condition);
+ if (!DBA::isResult($thr_parent)) {
+ // Shouldn't happen. But when this does, we just take the parent as thread parent.
+ // That's totally okay for what we use this variable here.
+ $thr_parent = $parent;
+ }
+
+ if (!empty($contact_id) && Model\Contact::isArchived($contact_id)) {
+ Logger::info('Contact is archived', ['id' => $contact_id, 'cmd' => $cmd, 'item' => $target_item['id']]);
+ self::setFailedQueue($cmd, $target_id);