diff --git a/boot.php b/boot.php
index 3571a77c16..d2597b378e 100644
--- a/boot.php
+++ b/boot.php
@@ -184,79 +184,6 @@ define('TERM_OBJ_POST', Term::OBJECT_TYPE_POST);
/** @deprecated since 2019.03, use Term::OBJECT_TYPE_PHOTO instead */
define('TERM_OBJ_PHOTO', Term::OBJECT_TYPE_PHOTO);
-/**
- * @name Namespaces
- *
- * Various namespaces we may need to parse
- * @{
- */
-define('NAMESPACE_ZOT', 'http://purl.org/zot');
-define('NAMESPACE_DFRN', 'http://purl.org/macgirvin/dfrn/1.0');
-define('NAMESPACE_THREAD', 'http://purl.org/syndication/thread/1.0');
-define('NAMESPACE_TOMB', 'http://purl.org/atompub/tombstones/1.0');
-define('NAMESPACE_ACTIVITY2', 'https://www.w3.org/ns/activitystreams#');
-define('NAMESPACE_ACTIVITY', 'http://activitystrea.ms/spec/1.0/');
-define('NAMESPACE_ACTIVITY_SCHEMA', 'http://activitystrea.ms/schema/1.0/');
-define('NAMESPACE_MEDIA', 'http://purl.org/syndication/atommedia');
-define('NAMESPACE_SALMON_ME', 'http://salmon-protocol.org/ns/magic-env');
-define('NAMESPACE_OSTATUSSUB', 'http://ostatus.org/schema/1.0/subscribe');
-define('NAMESPACE_GEORSS', 'http://www.georss.org/georss');
-define('NAMESPACE_POCO', 'http://portablecontacts.net/spec/1.0');
-define('NAMESPACE_FEED', 'http://schemas.google.com/g/2010#updates-from');
-define('NAMESPACE_OSTATUS', 'http://ostatus.org/schema/1.0');
-define('NAMESPACE_STATUSNET', 'http://status.net/schema/api/1/');
-define('NAMESPACE_ATOM1', 'http://www.w3.org/2005/Atom');
-define('NAMESPACE_MASTODON', 'http://mastodon.social/schema/1.0');
-/* @}*/
-
-/**
- * @name Activity
- *
- * Activity stream defines
- * @{
- */
-define('ACTIVITY_LIKE', NAMESPACE_ACTIVITY_SCHEMA . 'like');
-define('ACTIVITY_DISLIKE', NAMESPACE_DFRN . '/dislike');
-define('ACTIVITY_ATTEND', NAMESPACE_ZOT . '/activity/attendyes');
-define('ACTIVITY_ATTENDNO', NAMESPACE_ZOT . '/activity/attendno');
-define('ACTIVITY_ATTENDMAYBE', NAMESPACE_ZOT . '/activity/attendmaybe');
-
-define('ACTIVITY_OBJ_HEART', NAMESPACE_DFRN . '/heart');
-
-define('ACTIVITY_FRIEND', NAMESPACE_ACTIVITY_SCHEMA . 'make-friend');
-define('ACTIVITY_REQ_FRIEND', NAMESPACE_ACTIVITY_SCHEMA . 'request-friend');
-define('ACTIVITY_UNFRIEND', NAMESPACE_ACTIVITY_SCHEMA . 'remove-friend');
-define('ACTIVITY_FOLLOW', NAMESPACE_ACTIVITY_SCHEMA . 'follow');
-define('ACTIVITY_UNFOLLOW', NAMESPACE_ACTIVITY_SCHEMA . 'stop-following');
-define('ACTIVITY_JOIN', NAMESPACE_ACTIVITY_SCHEMA . 'join');
-
-define('ACTIVITY_POST', NAMESPACE_ACTIVITY_SCHEMA . 'post');
-define('ACTIVITY_UPDATE', NAMESPACE_ACTIVITY_SCHEMA . 'update');
-define('ACTIVITY_TAG', NAMESPACE_ACTIVITY_SCHEMA . 'tag');
-define('ACTIVITY_FAVORITE', NAMESPACE_ACTIVITY_SCHEMA . 'favorite');
-define('ACTIVITY_UNFAVORITE', NAMESPACE_ACTIVITY_SCHEMA . 'unfavorite');
-define('ACTIVITY_SHARE', NAMESPACE_ACTIVITY_SCHEMA . 'share');
-define('ACTIVITY_DELETE', NAMESPACE_ACTIVITY_SCHEMA . 'delete');
-define('ACTIVITY2_ANNOUNCE', NAMESPACE_ACTIVITY2 . 'Announce');
-
-define('ACTIVITY_POKE', NAMESPACE_ZOT . '/activity/poke');
-
-define('ACTIVITY_OBJ_BOOKMARK', NAMESPACE_ACTIVITY_SCHEMA . 'bookmark');
-define('ACTIVITY_OBJ_COMMENT', NAMESPACE_ACTIVITY_SCHEMA . 'comment');
-define('ACTIVITY_OBJ_NOTE', NAMESPACE_ACTIVITY_SCHEMA . 'note');
-define('ACTIVITY_OBJ_PERSON', NAMESPACE_ACTIVITY_SCHEMA . 'person');
-define('ACTIVITY_OBJ_IMAGE', NAMESPACE_ACTIVITY_SCHEMA . 'image');
-define('ACTIVITY_OBJ_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'photo');
-define('ACTIVITY_OBJ_VIDEO', NAMESPACE_ACTIVITY_SCHEMA . 'video');
-define('ACTIVITY_OBJ_P_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'profile-photo');
-define('ACTIVITY_OBJ_ALBUM', NAMESPACE_ACTIVITY_SCHEMA . 'photo-album');
-define('ACTIVITY_OBJ_EVENT', NAMESPACE_ACTIVITY_SCHEMA . 'event');
-define('ACTIVITY_OBJ_GROUP', NAMESPACE_ACTIVITY_SCHEMA . 'group');
-define('ACTIVITY_OBJ_TAGTERM', NAMESPACE_DFRN . '/tagterm');
-define('ACTIVITY_OBJ_PROFILE', NAMESPACE_DFRN . '/profile');
-define('ACTIVITY_OBJ_QUESTION', 'http://activityschema.org/object/question');
-/* @}*/
-
/**
* @name Gravity
*
diff --git a/include/api.php b/include/api.php
index 7daf134551..91e31ac945 100644
--- a/include/api.php
+++ b/include/api.php
@@ -41,6 +41,7 @@ use Friendica\Network\HTTPException\NotImplementedException;
use Friendica\Network\HTTPException\TooManyRequestsException;
use Friendica\Network\HTTPException\UnauthorizedException;
use Friendica\Object\Image;
+use Friendica\Protocol\Activity;
use Friendica\Protocol\Diaspora;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
@@ -2839,19 +2840,19 @@ function api_format_items_activities($item, $type = "json")
// get user data and add it to the array of the activity
$user = api_get_user($a, $parent_item['author-id']);
switch ($parent_item['verb']) {
- case ACTIVITY_LIKE:
+ case Activity::LIKE:
$activities['like'][] = $user;
break;
- case ACTIVITY_DISLIKE:
+ case Activity::DISLIKE:
$activities['dislike'][] = $user;
break;
- case ACTIVITY_ATTEND:
+ case Activity::ATTEND:
$activities['attendyes'][] = $user;
break;
- case ACTIVITY_ATTENDNO:
+ case Activity::ATTENDNO:
$activities['attendno'][] = $user;
break;
- case ACTIVITY_ATTENDMAYBE:
+ case Activity::ATTENDMAYBE:
$activities['attendmaybe'][] = $user;
break;
default:
@@ -5110,7 +5111,7 @@ function api_get_announce($item)
}
$fields = ['author-id', 'author-name', 'author-link', 'author-avatar'];
- $activity = Item::activityToIndex(ACTIVITY2_ANNOUNCE);
+ $activity = Item::activityToIndex(Activity::ANNOUNCE);
$condition = ['parent-uri' => $item['uri'], 'gravity' => GRAVITY_ACTIVITY, 'uid' => [0, $item['uid']], 'activity' => $activity];
$announce = Item::selectFirstForUser($item['uid'], $fields, $condition, ['order' => ['received' => true]]);
if (!DBA::isResult($announce)) {
diff --git a/include/conversation.php b/include/conversation.php
index 8bcd1b338f..84e47d34e3 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -27,12 +27,12 @@ use Friendica\Model\Term;
use Friendica\Object\Post;
use Friendica\Object\Thread;
use Friendica\Protocol\Activity;
+use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Proxy as ProxyUtils;
-use Friendica\Util\Temporal;
use Friendica\Util\Strings;
+use Friendica\Util\Temporal;
use Friendica\Util\XML;
-use Friendica\Util\Crypto;
function item_extract_images($body) {
@@ -145,11 +145,11 @@ function localize_item(&$item)
$activity = BaseObject::getClass(Activity::class);
$xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">";
- if ($activity->match($item['verb'], ACTIVITY_LIKE)
- || $activity->match($item['verb'], ACTIVITY_DISLIKE)
- || $activity->match($item['verb'], ACTIVITY_ATTEND)
- || $activity->match($item['verb'], ACTIVITY_ATTENDNO)
- || $activity->match($item['verb'], ACTIVITY_ATTENDMAYBE)) {
+ if ($activity->match($item['verb'], Activity::LIKE)
+ || $activity->match($item['verb'], Activity::DISLIKE)
+ || $activity->match($item['verb'], Activity::ATTEND)
+ || $activity->match($item['verb'], Activity::ATTENDNO)
+ || $activity->match($item['verb'], Activity::ATTENDMAYBE)) {
$fields = ['author-link', 'author-name', 'verb', 'object-type', 'resource-id', 'body', 'plink'];
$obj = Item::selectFirst($fields, ['uri' => $item['parent-uri']]);
@@ -161,9 +161,9 @@ function localize_item(&$item)
$objauthor = '[url=' . $obj['author-link'] . ']' . $obj['author-name'] . '[/url]';
switch ($obj['verb']) {
- case ACTIVITY_POST:
+ case Activity::POST:
switch ($obj['object-type']) {
- case ACTIVITY_OBJ_EVENT:
+ case Activity\ObjectType::EVENT:
$post_type = L10n::t('event');
break;
default:
@@ -184,24 +184,24 @@ function localize_item(&$item)
$plink = '[url=' . $obj['plink'] . ']' . $post_type . '[/url]';
$bodyverb = '';
- if ($activity->match($item['verb'], ACTIVITY_LIKE)) {
+ if ($activity->match($item['verb'], Activity::LIKE)) {
$bodyverb = L10n::t('%1$s likes %2$s\'s %3$s');
- } elseif ($activity->match($item['verb'], ACTIVITY_DISLIKE)) {
+ } elseif ($activity->match($item['verb'], Activity::DISLIKE)) {
$bodyverb = L10n::t('%1$s doesn\'t like %2$s\'s %3$s');
- } elseif ($activity->match($item['verb'], ACTIVITY_ATTEND)) {
+ } elseif ($activity->match($item['verb'], Activity::ATTEND)) {
$bodyverb = L10n::t('%1$s attends %2$s\'s %3$s');
- } elseif ($activity->match($item['verb'], ACTIVITY_ATTENDNO)) {
+ } elseif ($activity->match($item['verb'], Activity::ATTENDNO)) {
$bodyverb = L10n::t('%1$s doesn\'t attend %2$s\'s %3$s');
- } elseif ($activity->match($item['verb'], ACTIVITY_ATTENDMAYBE)) {
+ } elseif ($activity->match($item['verb'], Activity::ATTENDMAYBE)) {
$bodyverb = L10n::t('%1$s attends maybe %2$s\'s %3$s');
}
$item['body'] = sprintf($bodyverb, $author, $objauthor, $plink);
}
- if ($activity->match($item['verb'], ACTIVITY_FRIEND)) {
+ if ($activity->match($item['verb'], Activity::FRIEND)) {
- if ($item['object-type']=="" || $item['object-type']!== ACTIVITY_OBJ_PERSON) return;
+ if ($item['object-type']=="" || $item['object-type']!== Activity\ObjectType::PERSON) return;
$Aname = $item['author-name'];
$Alink = $item['author-link'];
@@ -231,12 +231,12 @@ function localize_item(&$item)
$item['body'] = L10n::t('%1$s is now friends with %2$s', $A, $B)."\n\n\n".$Bphoto;
}
- if (stristr($item['verb'], ACTIVITY_POKE)) {
+ if (stristr($item['verb'], Activity::POKE)) {
$verb = urldecode(substr($item['verb'],strpos($item['verb'],'#')+1));
if (!$verb) {
return;
}
- if ($item['object-type']=="" || $item['object-type']!== ACTIVITY_OBJ_PERSON) {
+ if ($item['object-type']=="" || $item['object-type']!== Activity\ObjectType::PERSON) {
return;
}
@@ -281,7 +281,7 @@ function localize_item(&$item)
}
- if ($activity->match($item['verb'], ACTIVITY_TAG)) {
+ if ($activity->match($item['verb'], Activity::TAG)) {
$fields = ['author-id', 'author-link', 'author-name', 'author-network',
'verb', 'object-type', 'resource-id', 'body', 'plink'];
$obj = Item::selectFirst($fields, ['uri' => $item['parent-uri']]);
@@ -298,9 +298,9 @@ function localize_item(&$item)
$objauthor = '[url=' . Contact::magicLinkByContact($author_arr) . ']' . $obj['author-name'] . '[/url]';
switch ($obj['verb']) {
- case ACTIVITY_POST:
+ case Activity::POST:
switch ($obj['object-type']) {
- case ACTIVITY_OBJ_EVENT:
+ case Activity\ObjectType::EVENT:
$post_type = L10n::t('event');
break;
default:
@@ -326,7 +326,7 @@ function localize_item(&$item)
$item['body'] = L10n::t('%1$s tagged %2$s\'s %3$s with %4$s', $author, $objauthor, $plink, $tag);
}
- if ($activity->match($item['verb'], ACTIVITY_FAVORITE)) {
+ if ($activity->match($item['verb'], Activity::FAVORITE)) {
if ($item['object-type'] == "") {
return;
}
@@ -402,19 +402,15 @@ function visible_activity($item) {
/** @var Activity $activity */
$activity = BaseObject::getClass(Activity::class);
- /*
- * likes (etc.) can apply to other things besides posts. Check if they are post children,
- * in which case we handle them specially
- */
- $hidden_activities = [ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE, ACTIVITY_FOLLOW, ACTIVITY2_ANNOUNCE];
- foreach ($hidden_activities as $act) {
- if ($activity->match($item['verb'], $act)) {
- return false;
- }
+ if ($activity->isHidden($item['verb'])) {
+ return false;
}
// @TODO below if() block can be rewritten to a single line: $isVisible = allConditionsHere;
- if ($activity->match($item['verb'], ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE && empty($item['self']) && $item['uid'] == local_user()) {
+ if ($activity->match($item['verb'], Activity::FOLLOW) &&
+ $item['object-type'] === Activity\ObjectType::NOTE &&
+ empty($item['self']) &&
+ $item['uid'] == local_user()) {
return false;
}
@@ -816,7 +812,7 @@ function conversation_fetch_comments($thread_items) {
$received = '';
while ($row = Item::fetch($thread_items)) {
- if (($row['verb'] == ACTIVITY2_ANNOUNCE) && !empty($row['contact-uid']) && ($row['received'] > $received) && ($row['thr-parent'] == $row['parent-uri'])) {
+ if (($row['verb'] == Activity::ANNOUNCE) && !empty($row['contact-uid']) && ($row['received'] > $received) && ($row['thr-parent'] == $row['parent-uri'])) {
$actor = ['link' => $row['author-link'], 'avatar' => $row['author-avatar'], 'name' => $row['author-name']];
$received = $row['received'];
}
@@ -1008,22 +1004,22 @@ function builtin_activity_puller($item, &$conv_responses) {
switch ($mode) {
case 'like':
- $verb = ACTIVITY_LIKE;
+ $verb = Activity::LIKE;
break;
case 'dislike':
- $verb = ACTIVITY_DISLIKE;
+ $verb = Activity::DISLIKE;
break;
case 'attendyes':
- $verb = ACTIVITY_ATTEND;
+ $verb = Activity::ATTEND;
break;
case 'attendno':
- $verb = ACTIVITY_ATTENDNO;
+ $verb = Activity::ATTENDNO;
break;
case 'attendmaybe':
- $verb = ACTIVITY_ATTENDMAYBE;
+ $verb = Activity::ATTENDMAYBE;
break;
case 'announce':
- $verb = ACTIVITY2_ANNOUNCE;
+ $verb = Activity::ANNOUNCE;
break;
default:
return;
@@ -1386,7 +1382,7 @@ function smart_flatten_conversation(array $parent)
if (isset($child['children']) && count($child['children'])) {
// This helps counting only the regular posts
$count_post_closure = function($var) {
- return $var['verb'] === ACTIVITY_POST;
+ return $var['verb'] === Activity::POST;
};
$child_post_count = count(array_filter($child['children'], $count_post_closure));
@@ -1398,7 +1394,7 @@ function smart_flatten_conversation(array $parent)
// Searches the post item in the children
$j = 0;
- while($child['children'][$j]['verb'] !== ACTIVITY_POST && $j < count($child['children'])) {
+ while($child['children'][$j]['verb'] !== Activity::POST && $j < count($child['children'])) {
$j ++;
}
diff --git a/include/enotify.php b/include/enotify.php
index 01c946d1ff..a8090e35f8 100644
--- a/include/enotify.php
+++ b/include/enotify.php
@@ -13,6 +13,7 @@ use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Item;
use Friendica\Model\User;
+use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Emailer;
use Friendica\Util\Strings;
@@ -338,7 +339,7 @@ function notification($params)
$hsitelink = sprintf($sitelink, ''.$sitename.'');
switch ($params['verb']) {
- case ACTIVITY_FRIEND:
+ case Activity::FRIEND:
// someone started to share with user (mostly OStatus)
$subject = L10n::t('[Friendica:Notify] A new person is sharing with you');
@@ -348,7 +349,7 @@ function notification($params)
$sitename
);
break;
- case ACTIVITY_FOLLOW:
+ case Activity::FOLLOW:
// someone started to follow the user (mostly OStatus)
$subject = L10n::t('[Friendica:Notify] You have a new follower');
@@ -385,7 +386,7 @@ function notification($params)
}
if ($params['type'] == NOTIFY_CONFIRM) {
- if ($params['verb'] == ACTIVITY_FRIEND) { // mutual connection
+ if ($params['verb'] == Activity::FRIEND) { // mutual connection
$itemlink = $params['link'];
$subject = L10n::t('[Friendica:Notify] Connection accepted');
@@ -821,7 +822,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
if ($send_notification) {
$params["type"] = NOTIFY_SHARE;
- $params["verb"] = ACTIVITY_TAG;
+ $params["verb"] = Activity::TAG;
}
}
@@ -835,7 +836,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
if ($item["mention"] || $tagged || ($defaulttype == NOTIFY_TAGSELF)) {
$params["type"] = NOTIFY_TAGSELF;
- $params["verb"] = ACTIVITY_TAG;
+ $params["verb"] = Activity::TAG;
}
// Is it a post that the user had started?
@@ -844,7 +845,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
if ($thread['mention'] && !$thread['ignored'] && !isset($params["type"])) {
$params["type"] = NOTIFY_COMMENT;
- $params["verb"] = ACTIVITY_POST;
+ $params["verb"] = Activity::POST;
}
// And now we check for participation of one of our contacts in the thread
@@ -852,7 +853,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
if (!$thread['ignored'] && !isset($params["type"]) && Item::exists($condition)) {
$params["type"] = NOTIFY_COMMENT;
- $params["verb"] = ACTIVITY_POST;
+ $params["verb"] = Activity::POST;
}
if (isset($params["type"])) {
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 944ba98be2..c92e5493a1 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -28,6 +28,7 @@ use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\User;
use Friendica\Network\Probe;
+use Friendica\Protocol\Activity;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
@@ -538,7 +539,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
'source_name' => ((strlen(stripslashes($combined['name']))) ? stripslashes($combined['name']) : L10n::t('[Name Withheld]')),
'source_link' => $combined['url'],
'source_photo' => $combined['photo'],
- 'verb' => ($mutual?ACTIVITY_FRIEND:ACTIVITY_FOLLOW),
+ 'verb' => ($mutual ? Activity::FRIEND : Activity::FOLLOW),
'otype' => 'intro'
]);
}
diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php
index f37064573b..a9e17b34b3 100644
--- a/mod/dfrn_request.php
+++ b/mod/dfrn_request.php
@@ -27,6 +27,7 @@ use Friendica\Model\Profile;
use Friendica\Model\User;
use Friendica\Module\Login;
use Friendica\Network\Probe;
+use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\Strings;
@@ -561,7 +562,7 @@ function dfrn_request_content(App $a)
'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : L10n::t('[Name Withheld]')),
'source_link' => $r[0]['url'],
'source_photo' => $r[0]['photo'],
- 'verb' => ACTIVITY_REQ_FRIEND,
+ 'verb' => Activity::REQ_FRIEND,
'otype' => 'intro'
]);
}
diff --git a/mod/item.php b/mod/item.php
index a5875d258b..a96d288193 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -36,6 +36,7 @@ use Friendica\Model\FileTag;
use Friendica\Model\Item;
use Friendica\Model\Photo;
use Friendica\Model\Term;
+use Friendica\Protocol\Activity;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\Email;
use Friendica\Util\ACLFormatter;
@@ -133,7 +134,7 @@ function item_post(App $a) {
$toplevel_item_id = $toplevel_item['id'];
$parent_user = $toplevel_item['uid'];
- $objecttype = ACTIVITY_OBJ_COMMENT;
+ $objecttype = Activity\ObjectType::COMMENT;
}
if ($toplevel_item_id) {
@@ -466,7 +467,7 @@ function item_post(App $a) {
$match = null;
if (!$preview && Photo::setPermissionFromBody($body, $profile_uid, $original_contact_id, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny)) {
- $objecttype = ACTIVITY_OBJ_IMAGE;
+ $objecttype = Activity\ObjectType::IMAGE;
}
/*
@@ -502,7 +503,7 @@ function item_post(App $a) {
if ((preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", $body, $match, PREG_SET_ORDER) || isset($data["type"]))
&& ($posttype != Item::PT_PERSONAL_NOTE)) {
$posttype = Item::PT_PAGE;
- $objecttype = ACTIVITY_OBJ_BOOKMARK;
+ $objecttype = Activity\ObjectType::BOOKMARK;
}
/** @var BBCode\Video $bbCodeVideo */
@@ -516,15 +517,15 @@ function item_post(App $a) {
// Setting the object type if not defined before
if (!$objecttype) {
- $objecttype = ACTIVITY_OBJ_NOTE; // Default value
+ $objecttype = Activity\ObjectType::NOTE; // Default value
$objectdata = BBCode::getAttachedData($body);
if ($objectdata["type"] == "link") {
- $objecttype = ACTIVITY_OBJ_BOOKMARK;
+ $objecttype = Activity\ObjectType::BOOKMARK;
} elseif ($objectdata["type"] == "video") {
- $objecttype = ACTIVITY_OBJ_VIDEO;
+ $objecttype = Activity\ObjectType::VIDEO;
} elseif ($objectdata["type"] == "photo") {
- $objecttype = ACTIVITY_OBJ_IMAGE;
+ $objecttype = Activity\ObjectType::IMAGE;
}
}
@@ -549,7 +550,7 @@ function item_post(App $a) {
}
if (!strlen($verb)) {
- $verb = ACTIVITY_POST;
+ $verb = Activity::POST;
}
if ($network == "") {
@@ -761,7 +762,7 @@ function item_post(App $a) {
'source_name' => $datarray['author-name'],
'source_link' => $datarray['author-link'],
'source_photo' => $datarray['author-avatar'],
- 'verb' => ACTIVITY_POST,
+ 'verb' => Activity::POST,
'otype' => 'item',
'parent' => $toplevel_item_id,
'parent_uri' => $toplevel_item['uri']
@@ -781,7 +782,7 @@ function item_post(App $a) {
'source_name' => $datarray['author-name'],
'source_link' => $datarray['author-link'],
'source_photo' => $datarray['author-avatar'],
- 'verb' => ACTIVITY_POST,
+ 'verb' => Activity::POST,
'otype' => 'item'
]);
}
diff --git a/mod/photos.php b/mod/photos.php
index d89cd04b0b..037da64b10 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -25,6 +25,7 @@ use Friendica\Model\Profile;
use Friendica\Model\User;
use Friendica\Network\Probe;
use Friendica\Object\Image;
+use Friendica\Protocol\Activity;
use Friendica\Util\ACLFormatter;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
@@ -566,24 +567,24 @@ function photos_post(App $a)
$arr['deny_cid'] = $photo['deny_cid'];
$arr['deny_gid'] = $photo['deny_gid'];
$arr['visible'] = 1;
- $arr['verb'] = ACTIVITY_TAG;
+ $arr['verb'] = Activity::TAG;
$arr['gravity'] = GRAVITY_PARENT;
- $arr['object-type'] = ACTIVITY_OBJ_PERSON;
- $arr['target-type'] = ACTIVITY_OBJ_IMAGE;
+ $arr['object-type'] = Activity\ObjectType::PERSON;
+ $arr['target-type'] = Activity\ObjectType::IMAGE;
$arr['tag'] = $tagged[4];
$arr['inform'] = $tagged[2];
$arr['origin'] = 1;
$arr['body'] = L10n::t('%1$s was tagged in %2$s by %3$s', '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . L10n::t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ;
$arr['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo['resource-id'] . ']' . '[img]' . System::baseUrl() . "/photo/" . $photo['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
- $arr['object'] = '