$item['network'] = Protocol::ACTIVITYPUB;
$item['author-link'] = $activity['author'];
- $item['author-id'] = Contact::getIdForURL($activity['author'], 0, false);
+ $item['author-id'] = Contact::getIdForURL($activity['author']);
$item['owner-link'] = $activity['actor'];
- $item['owner-id'] = Contact::getIdForURL($activity['actor'], 0, false);
+ $item['owner-id'] = Contact::getIdForURL($activity['actor']);
if (in_array(0, $activity['receiver']) && !empty($activity['unlisted'])) {
$item['private'] = Item::UNLISTED;
$item['uid'] = $receiver;
+ $type = $activity['reception_type'][$receiver] ?? Receiver::TARGET_UNKNOWN;
+ switch($type) {
+ case Receiver::TARGET_TO:
+ $item['post-type'] = Item::PT_TO;
+ break;
+ case Receiver::TARGET_CC:
+ $item['post-type'] = Item::PT_CC;
+ break;
+ case Receiver::TARGET_BTO:
+ $item['post-type'] = Item::PT_BTO;
+ break;
+ case Receiver::TARGET_BCC:
+ $item['post-type'] = Item::PT_BCC;
+ break;
+ case Receiver::TARGET_FOLLOWER:
+ $item['post-type'] = Item::PT_FOLLOWER;
+ break;
+ default:
+ $item['post-type'] = Item::PT_ARTICLE;
+ }
+
if ($item['isForum'] ?? false) {
- $item['contact-id'] = Contact::getIdForURL($activity['actor'], $receiver, false);
+ $item['contact-id'] = Contact::getIdForURL($activity['actor'], $receiver);
} else {
- $item['contact-id'] = Contact::getIdForURL($activity['author'], $receiver, false);
+ $item['contact-id'] = Contact::getIdForURL($activity['author'], $receiver);
}
if (($receiver != 0) && empty($item['contact-id'])) {
- $item['contact-id'] = Contact::getIdForURL($activity['author'], 0, false);
+ $item['contact-id'] = Contact::getIdForURL($activity['author']);
}
if (!empty($activity['directmessage'])) {
}
$owner = User::getOwnerDataById($uid);
+ if (empty($owner)) {
+ return;
+ }
$cid = Contact::getIdForURL($activity['actor'], $uid);
if (!empty($cid)) {
}
$owner = User::getOwnerDataById($uid);
+ if (empty($owner)) {
+ return;
+ }
$cid = Contact::getIdForURL($activity['actor'], $uid);
if (empty($cid)) {