$data = ['@context' => ActivityPub::CONTEXT];
$data['id'] = $contact['url'];
$data['diaspora:guid'] = $user['guid'];
$data = ['@context' => ActivityPub::CONTEXT];
$data['id'] = $contact['url'];
$data['diaspora:guid'] = $user['guid'];
'publicKeyPem' => $user['pubkey']];
$data['endpoints'] = ['sharedInbox' => System::baseUrl() . '/inbox'];
$data['icon'] = ['type' => 'Image',
'publicKeyPem' => $user['pubkey']];
$data['endpoints'] = ['sharedInbox' => System::baseUrl() . '/inbox'];
$data['icon'] = ['type' => 'Image',
if (Config::get('debug', 'total_ap_delivery')) {
// Will be activated in a later step
if (Config::get('debug', 'total_ap_delivery')) {
// Will be activated in a later step
} else {
// For now only send to these contacts:
$networks = [Protocol::ACTIVITYPUB, Protocol::OSTATUS];
} else {
// For now only send to these contacts:
$networks = [Protocol::ACTIVITYPUB, Protocol::OSTATUS];
if (Config::get('debug', 'total_ap_delivery')) {
// Will be activated in a later step
if (Config::get('debug', 'total_ap_delivery')) {
// Will be activated in a later step
} else {
// For now only send to these contacts:
$networks = [Protocol::ACTIVITYPUB, Protocol::OSTATUS];
} else {
// For now only send to these contacts:
$networks = [Protocol::ACTIVITYPUB, Protocol::OSTATUS];
$event['startTime'] = DateTimeFormat::utc($item['event-start'] . '+00:00', DateTimeFormat::ATOM);
if (!$item['event-nofinish']) {
$event['startTime'] = DateTimeFormat::utc($item['event-start'] . '+00:00', DateTimeFormat::ATOM);
if (!$item['event-nofinish']) {
$regexp = "/[@!]\[url\=([^\[\]]*)\].*?\[\/url\]/ism";
$body = preg_replace_callback($regexp, ['self', 'mentionCallback'], $body);
$regexp = "/[@!]\[url\=([^\[\]]*)\].*?\[\/url\]/ism";
$body = preg_replace_callback($regexp, ['self', 'mentionCallback'], $body);
public static function sendActivity($activity, $target, $uid, $id = '')
{
$profile = APContact::getByURL($target);
public static function sendActivity($activity, $target, $uid, $id = '')
{
$profile = APContact::getByURL($target);
public static function sendFollowObject($object, $target, $uid = 0)
{
$profile = APContact::getByURL($target);
public static function sendFollowObject($object, $target, $uid = 0)
{
$profile = APContact::getByURL($target);
public static function sendContactAccept($target, $id, $uid)
{
$profile = APContact::getByURL($target);
public static function sendContactAccept($target, $id, $uid)
{
$profile = APContact::getByURL($target);
$owner = User::getOwnerDataById($uid);
$data = ['@context' => ActivityPub::CONTEXT,
$owner = User::getOwnerDataById($uid);
$data = ['@context' => ActivityPub::CONTEXT,
public static function sendContactReject($target, $id, $uid)
{
$profile = APContact::getByURL($target);
public static function sendContactReject($target, $id, $uid)
{
$profile = APContact::getByURL($target);
$owner = User::getOwnerDataById($uid);
$data = ['@context' => ActivityPub::CONTEXT,
$owner = User::getOwnerDataById($uid);
$data = ['@context' => ActivityPub::CONTEXT,
public static function sendContactUndo($target, $cid, $uid)
{
$profile = APContact::getByURL($target);
public static function sendContactUndo($target, $cid, $uid)
{
$profile = APContact::getByURL($target);