Set extid via guid, nit via id

This commit is contained in:
Michael 2024-12-06 06:46:36 +00:00
parent da0905a6a8
commit bed9ff2bfd
2 changed files with 3 additions and 3 deletions

View file

@ -715,7 +715,7 @@ function bluesky_create_activity(array $item, stdClass $parent = null)
}
Logger::debug('Activity done', ['return' => $activity]);
$uri = bluesky_get_uri($activity);
Item::update(['extid' => $uri], ['id' => $item['id']]);
Item::update(['extid' => $uri], ['guid' => $item['guid']]);
Logger::debug('Set extid', ['id' => $item['id'], 'extid' => $activity]);
}
@ -806,7 +806,7 @@ function bluesky_create_post(array $item, stdClass $root = null, stdClass $paren
}
if (($key == 0) && ($item['gravity'] != Item::GRAVITY_PARENT)) {
$uri = bluesky_get_uri($parent);
Item::update(['extid' => $uri], ['id' => $item['id']]);
Item::update(['extid' => $uri], ['guid' => $item['guid']]);
Logger::debug('Set extid', ['id' => $item['id'], 'extid' => $uri]);
}
}

View file

@ -564,7 +564,7 @@ function tumblr_send(array &$b)
if ($result->meta->status < 400) {
Logger::info('Successfully performed activity', ['verb' => $b['verb'], 'deleted' => $b['deleted'], 'meta' => $result->meta, 'response' => $result->response]);
if (!$b['deleted'] && !empty($result->response->id_string)) {
Item::update(['extid' => 'tumblr::' . $result->response->id_string], ['id' => $b['id']]);
Item::update(['extid' => 'tumblr::' . $result->response->id_string], ['guid' => $b['guid']]);
}
} else {
Logger::notice('Error while performing activity', ['verb' => $b['verb'], 'deleted' => $b['deleted'], 'meta' => $result->meta, 'response' => $result->response, 'errors' => $result->errors, 'params' => $params]);