return $contact;
}
- if (empty($contact)) {
- $fields = [
- 'uid' => $contact_uid,
- 'network' => Protocol::BLUESKY,
- 'priority' => 1,
- 'writable' => true,
- 'blocked' => false,
- 'readonly' => false,
- 'pending' => false,
- 'url' => $did,
- 'nurl' => $did,
- 'alias' => ATProtocol::WEB . '/profile/' . $did,
- 'name' => $did,
- 'nick' => $did,
- 'addr' => $did,
- 'rel' => Contact::NOTHING,
- ];
- $cid = Contact::insert($fields);
- } else {
- $cid = $contact['id'];
- }
+ $fields = [
+ 'uid' => $contact_uid,
+ 'network' => Protocol::BLUESKY,
+ 'priority' => 1,
+ 'writable' => true,
+ 'blocked' => false,
+ 'readonly' => false,
+ 'pending' => false,
+ 'url' => $did,
+ 'nurl' => $did,
+ 'alias' => ATProtocol::WEB . '/profile/' . $did,
+ 'name' => $did,
+ 'nick' => $did,
+ 'addr' => $did,
+ 'rel' => Contact::NOTHING,
+ ];
+
+ $cid = Contact::insert($fields);
$this->updateContactByDID($did);
public function createPost(stdClass $data, array $uids, bool $dont_fetch)
{
+ $parent = '';
+
if (!empty($data->commit->record->reply)) {
$root = $this->getUri($data->commit->record->reply->root);
$parent = $this->getUri($data->commit->record->reply->parent);
return;
}
}
- $item = $this->addMedia($post->thread->post->embed, $item, 0, 0, 0);
+ $item = $this->addMedia($post->thread->post->embed, $item, 0);
}
$id = Item::insert($item);
}
if (!empty($post->embed)) {
- $item = $this->addMedia($post->embed, $item, $uid, $level);
+ $item = $this->addMedia($post->embed, $item, $level);
}
$item['restrictions'] = $this->getRestrictionsForUser($post, $item, $post_reason);
}
$elements = explode(':', $uri);
- if (empty($elements) || ($elements[0] != 'at')) {
+ if ($elements[0] !== 'at') {
$post = Post::selectFirstPost(['extid'], ['uri' => $uri]);
return $this->getUriClass($post['extid'] ?? '');
}