$data['summary'] = BBCode::convertForUriId($owner['uri-id'] ?? 0, $owner['about'], BBCode::EXTERNAL);
}
+ if (!empty($owner['xmpp']) || !empty($owner['matrix'])) {
+ $data['vcard:hasInstantMessage'] = [];
+
+ if (!empty($owner['xmpp'])) {
+ $data['vcard:hasInstantMessage'][] = 'xmpp:' . $owner['xmpp'];
+ }
+ if (!empty($owner['matrix'])) {
+ $data['vcard:hasInstantMessage'][] = 'matrix:' . $owner['matrix'];
+ }
+ }
+
$data['url'] = $owner['url'];
$data['manuallyApprovesFollowers'] = in_array($owner['page-flags'], [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_PRVGROUP]);
- $data['discoverable'] = $owner['net-publish'];
+ $data['discoverable'] = (bool)$owner['net-publish'];
$data['publicKey'] = ['id' => $owner['url'] . '#main-key',
'owner' => $owner['url'],
'publicKeyPem' => $owner['pubkey']];
}
}
+ $custom_fields = [];
+
+ foreach (DI::profileField()->selectByContactId(0, $uid) as $profile_field) {
+ $custom_fields[] = [
+ 'type' => 'PropertyValue',
+ 'name' => $profile_field->label,
+ 'value' => BBCode::convertForUriId($owner['uri-id'], $profile_field->value)
+ ];
+ };
+
+ if (!empty($custom_fields)) {
+ $data['attachment'] = $custom_fields;
+ }
+
$data['generator'] = self::getService();
// tags: https://kitty.town/@inmysocks/100656097926961126.json
}
$reply = DBA::selectFirst('mail', ['uri', 'uri-id', 'from-url'], ['parent-uri' => $mail['parent-uri'], 'reply' => false]);
+ if (!DBA::isResult($reply)) {
+ $reply = $mail;
+ }
// Making the post more compatible for Mastodon by:
// - Making it a note and not an article (no title)