if ($curlResult->isSuccess() && !empty($curlResult->getBody())) {
$noscrape = json_decode($curlResult->getBody(), true);
- if (!empty($noscrape)) {
+ if (!empty($noscrape) && !empty($noscrape['updated'])) {
$noscrape['updated'] = DateTimeFormat::utc($noscrape['updated'], DateTimeFormat::MYSQL);
$fields = ['last_contact' => DateTimeFormat::utcNow(), 'updated' => $noscrape['updated']];
DBA::update('gcontact', $fields, ['nurl' => Strings::normaliseLink($data['url'])]);
'birthday' => $userdata['dob'], 'photo' => $userdata['photo'],
"notify" => $userdata['notify'], 'url' => $userdata['url'],
"hide" => ($userdata['hidewall'] || !$userdata['net-publish']),
- 'nick' => $userdata['nickname'], 'addr' => $addr,
- "connect" => $addr, "server_url" => System::baseUrl(),
+ 'nick' => $userdata['nickname'], 'addr' => $userdata['addr'],
+ "connect" => $userdata['addr'], "server_url" => System::baseUrl(),
"generation" => 1, 'network' => Protocol::DFRN];
self::update($gcontact);
$fields = ['network', 'author-id', 'author-link', 'owner-id'];
$condition = ['uri' => $target_item["thr-parent"], 'uid' => $target_item["uid"]];
$thr_parent = Item::selectFirst($fields, $condition);
+ if (empty($thr_parent)) {
+ $thr_parent = $parent;
+ }
Logger::log('GUID: ' . $target_item["guid"] . ': Parent is ' . $parent['network'] . '. Thread parent is ' . $thr_parent['network'], Logger::DEBUG);