'owner' => $owner['url'],
'publicKeyPem' => $owner['pubkey']];
$data['endpoints'] = ['sharedInbox' => DI::baseUrl() . '/inbox'];
- $data['icon'] = ['type' => 'Image', 'url' => Contact::getAvatarUrlForId($owner['id'], '', $owner['updated'])];
+ $data['icon'] = ['type' => 'Image', 'url' => User::getAvatarUrlForId($uid)];
$resourceid = Photo::ridFromURI($owner['photo']);
if (!empty($resourceid)) {
}
}
+ $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
* @param string $target Target profile
* @param $id
* @param integer $uid User ID
- * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+ * @return bool Operation success
+ * @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- public static function sendContactReject($target, $id, $uid)
+ public static function sendContactReject($target, $id, $uid): bool
{
$profile = APContact::getByURL($target);
if (empty($profile['inbox'])) {
Logger::warning('No inbox found for target', ['target' => $target, 'profile' => $profile]);
- return;
+ return false;
}
$owner = User::getOwnerDataById($uid);
Logger::debug('Sending reject to ' . $target . ' for user ' . $uid . ' with id ' . $id);
$signed = LDSignature::sign($data, $owner);
- HTTPSignature::transmit($signed, $profile['inbox'], $uid);
+ return HTTPSignature::transmit($signed, $profile['inbox'], $uid);
}
/**