use Friendica\Core\Protocol;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
-use Friendica\Protocol\Activity\ANamespace;
+use Friendica\Protocol\Activity\ActivityNamespace;
use Friendica\Protocol\OStatus;
use Friendica\Protocol\Salmon;
use Friendica\Util\Crypto;
// parse the xml
- $dom = simplexml_load_string($xml,'SimpleXMLElement',0, ANamespace::SALMON_ME);
+ $dom = simplexml_load_string($xml,'SimpleXMLElement',0, ActivityNamespace::SALMON_ME);
$base = null;
use Friendica\Database\DBA;
use Friendica\Model\Photo;
use Friendica\Model\User;
-use Friendica\Protocol\Activity\ANamespace;
+use Friendica\Protocol\Activity\ActivityNamespace;
use Friendica\Protocol\Salmon;
use Friendica\Util\Strings;
],
'links' => [
[
- 'rel' => ANamespace::DFRN ,
+ 'rel' => ActivityNamespace::DFRN ,
'href' => $owner['url'],
],
[
- 'rel' => ANamespace::FEED,
+ 'rel' => ActivityNamespace::FEED,
'type' => 'application/atom+xml',
'href' => $owner['poll'],
],
'href' => $baseURL . '/hcard/' . $owner['nickname'],
],
[
- 'rel' => ANamespace::POCO,
+ 'rel' => ActivityNamespace::POCO,
'href' => $owner['poco'],
],
[
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Profile;
-use Friendica\Protocol\Activity\ANamespace;
+use Friendica\Protocol\Activity\ActivityNamespace;
use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\Email;
use Friendica\Protocol\Feed;
Logger::log('webfingerDfrn: '.$webbie.':'.print_r($links, true), Logger::DATA);
if (!empty($links) && is_array($links)) {
foreach ($links as $link) {
- if ($link['@attributes']['rel'] === ANamespace::DFRN) {
+ if ($link['@attributes']['rel'] === ActivityNamespace::DFRN) {
$profile_link = $link['@attributes']['href'];
}
- if (($link['@attributes']['rel'] === ANamespace::OSTATUSSUB) && ($profile_link == "")) {
+ if (($link['@attributes']['rel'] === ActivityNamespace::OSTATUSSUB) && ($profile_link == "")) {
$profile_link = 'stat:'.$link['@attributes']['template'];
}
if ($link['@attributes']['rel'] === 'http://microformats.org/profile/hcard') {
$has_key = false;
foreach ($webfinger['links'] as $link) {
- if ($link['rel'] == ANamespace::OSTATUSSUB) {
+ if ($link['rel'] == ActivityNamespace::OSTATUSSUB) {
$is_ostatus = true;
}
if ($link['rel'] == 'magic-public-key') {
// The array is reversed to take into account the order of preference for same-rel links
// See: https://tools.ietf.org/html/rfc7033#section-4.4.4
foreach (array_reverse($webfinger["links"]) as $link) {
- if (($link["rel"] == ANamespace::DFRN) && !empty($link["href"])) {
+ if (($link["rel"] == ActivityNamespace::DFRN) && !empty($link["href"])) {
$data["network"] = Protocol::DFRN;
- } elseif (($link["rel"] == ANamespace::FEED) && !empty($link["href"])) {
+ } elseif (($link["rel"] == ActivityNamespace::FEED) && !empty($link["href"])) {
$data["poll"] = $link["href"];
} elseif (($link["rel"] == "http://webfinger.net/rel/profile-page") && (($link["type"] ?? "") == "text/html") && !empty($link["href"])) {
$data["url"] = $link["href"];
} elseif (($link["rel"] == "http://microformats.org/profile/hcard") && !empty($link["href"])) {
$hcard_url = $link["href"];
- } elseif (($link["rel"] == ANamespace::POCO) && !empty($link["href"])) {
+ } elseif (($link["rel"] == ActivityNamespace::POCO) && !empty($link["href"])) {
$data["poco"] = $link["href"];
} elseif (($link["rel"] == "http://webfinger.net/rel/avatar") && !empty($link["href"])) {
$data["photo"] = $link["href"];
$data["guid"] = $link["href"];
} elseif (($link["rel"] == "http://webfinger.net/rel/profile-page") && (($link["type"] ?? "") == "text/html") && !empty($link["href"])) {
$data["url"] = $link["href"];
- } elseif (($link["rel"] == ANamespace::FEED) && !empty($link["href"])) {
+ } elseif (($link["rel"] == ActivityNamespace::FEED) && !empty($link["href"])) {
$data["poll"] = $link["href"];
- } elseif (($link["rel"] == ANamespace::POCO) && !empty($link["href"])) {
+ } elseif (($link["rel"] == ActivityNamespace::POCO) && !empty($link["href"])) {
$data["poco"] = $link["href"];
} elseif (($link["rel"] == "salmon") && !empty($link["href"])) {
$data["notify"] = $link["href"];
$data["url"] = $link["href"];
} elseif (($link["rel"] == "salmon") && !empty($link["href"])) {
$data["notify"] = $link["href"];
- } elseif (($link["rel"] == ANamespace::FEED) && !empty($link["href"])) {
+ } elseif (($link["rel"] == ActivityNamespace::FEED) && !empty($link["href"])) {
$data["poll"] = $link["href"];
} elseif (($link["rel"] == "magic-public-key") && !empty($link["href"])) {
$pubkey = $link["href"];
namespace Friendica\Protocol;
-use Friendica\Protocol\Activity\ANamespace;
+use Friendica\Protocol\Activity\ActivityNamespace;
/**
* Base class for the Activity Verbs
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const LIKE = ANamespace::ACTIVITY_SCHEMA . 'like';
+ const LIKE = ActivityNamespace::ACTIVITY_SCHEMA . 'like';
/**
* Dislike a message ("I don't like the post")
*
* @see http://purl.org/macgirvin/dfrn/1.0/dislike
* @var string
*/
- const DISLIKE = ANamespace::DFRN . '/dislike';
+ const DISLIKE = ActivityNamespace::DFRN . '/dislike';
/**
* Attend an event
* @see https://github.com/friendica/friendica/wiki/ActivityStreams#activity_attend
* @var string
*/
- const ATTEND = ANamespace::ZOT . '/activity/attendyes';
+ const ATTEND = ActivityNamespace::ZOT . '/activity/attendyes';
/**
* Don't attend an event
*
* @see https://github.com/friendica/friendica/wiki/ActivityStreams#activity_attendno
* @var string
*/
- const ATTENDNO = ANamespace::ZOT . '/activity/attendno';
+ const ATTENDNO = ActivityNamespace::ZOT . '/activity/attendno';
/**
* Attend maybe an event
*
* @see https://github.com/friendica/friendica/wiki/ActivityStreams#activity_attendmaybe
* @var string
*/
- const ATTENDMAYBE = ANamespace::ZOT . '/activity/attendmaybe';
+ const ATTENDMAYBE = ActivityNamespace::ZOT . '/activity/attendmaybe';
/**
* Indicates the creation of a friendship that is reciprocated by the object.
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const FRIEND = ANamespace::ACTIVITY_SCHEMA . 'make-friend';
+ const FRIEND = ActivityNamespace::ACTIVITY_SCHEMA . 'make-friend';
/**
* Indicates the creation of a friendship that has not yet been reciprocated by the object.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const REQ_FRIEND = ANamespace::ACTIVITY_SCHEMA . 'request-friend';
+ const REQ_FRIEND = ActivityNamespace::ACTIVITY_SCHEMA . 'request-friend';
/**
* Indicates that the actor has removed the object from the collection of friends.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const UNFRIEND = ANamespace::ACTIVITY_SCHEMA . 'remove-friend';
+ const UNFRIEND = ActivityNamespace::ACTIVITY_SCHEMA . 'remove-friend';
/**
* Indicates that the actor began following the activity of the object.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const FOLLOW = ANamespace::ACTIVITY_SCHEMA . 'follow';
+ const FOLLOW = ActivityNamespace::ACTIVITY_SCHEMA . 'follow';
/**
* Indicates that the actor has stopped following the object.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const UNFOLLOW = ANamespace::ACTIVITY_SCHEMA . 'stop-following';
+ const UNFOLLOW = ActivityNamespace::ACTIVITY_SCHEMA . 'stop-following';
/**
* Indicates that the actor has become a member of the object.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const JOIN = ANamespace::ACTIVITY_SCHEMA . 'join';
+ const JOIN = ActivityNamespace::ACTIVITY_SCHEMA . 'join';
/**
* Implementors SHOULD use verbs such as post where the actor is adding new items to a collection or similar.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const POST = ANamespace::ACTIVITY_SCHEMA . 'post';
+ const POST = ActivityNamespace::ACTIVITY_SCHEMA . 'post';
/**
* The "update" verb indicates that the actor has modified the object.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const UPDATE = ANamespace::ACTIVITY_SCHEMA . 'update';
+ const UPDATE = ActivityNamespace::ACTIVITY_SCHEMA . 'update';
/**
* Indicates that the actor has identified the presence of a target inside another object.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const TAG = ANamespace::ACTIVITY_SCHEMA . 'tag';
+ const TAG = ActivityNamespace::ACTIVITY_SCHEMA . 'tag';
/**
* Indicates that the actor marked the object as an item of special interest.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const FAVORITE = ANamespace::ACTIVITY_SCHEMA . 'favorite';
+ const FAVORITE = ActivityNamespace::ACTIVITY_SCHEMA . 'favorite';
/**
* Indicates that the actor has removed the object from the collection of favorited items.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const UNFAVORITE = ANamespace::ACTIVITY_SCHEMA . 'unfavorite';
+ const UNFAVORITE = ActivityNamespace::ACTIVITY_SCHEMA . 'unfavorite';
/**
* Indicates that the actor has called out the object to readers.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const SHARE = ANamespace::ACTIVITY_SCHEMA . 'share';
+ const SHARE = ActivityNamespace::ACTIVITY_SCHEMA . 'share';
/**
* Indicates that the actor has deleted the object.
*
* @see http://activitystrea.ms/head/activity-schema.html#verbs
* @var string
*/
- const DELETE = ANamespace::ACTIVITY_SCHEMA . 'delete';
+ const DELETE = ActivityNamespace::ACTIVITY_SCHEMA . 'delete';
/**
* Indicates that the actor is calling the target's attention the object.
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-announce
* @var string
*/
- const ANNOUNCE = ANamespace::ACTIVITY2 . 'Announce';
+ const ANNOUNCE = ActivityNamespace::ACTIVITY2 . 'Announce';
/**
* Pokes an user.
* @see https://github.com/friendica/friendica/wiki/ActivityStreams#activity_poke
* @var string
*/
- const POKE = ANamespace::ZOT . '/activity/poke';
+ const POKE = ActivityNamespace::ZOT . '/activity/poke';
- const O_UNFOLLOW = ANamespace::OSTATUS . '/unfollow';
- const O_UNFAVOURITE = ANamespace::OSTATUS . '/unfavorite';
+ const O_UNFOLLOW = ActivityNamespace::OSTATUS . '/unfollow';
+ const O_UNFAVOURITE = ActivityNamespace::OSTATUS . '/unfavorite';
/**
* likes (etc.) can apply to other things besides posts. Check if they are post children,
{
return (($haystack === $needle) ||
((basename($needle) === $haystack) &&
- strstr($needle, ANamespace::ACTIVITY_SCHEMA)));
+ strstr($needle, ActivityNamespace::ACTIVITY_SCHEMA)));
}
}
+++ /dev/null
-<?php
-
-namespace Friendica\Protocol\Activity;
-
-/**
- * Activity namespaces constants
- */
-final class ANamespace
-{
- /**
- * Zot is a WebMTA which provides a decentralised identity and communications protocol using HTTPS/JSON.
- *
- * @var string
- * @see https://zotlabs.org/page/zotlabs/specs+zot6+home
- */
- const ZOT = 'http://purl.org/zot';
- /**
- * Friendica is using ActivityStreams in version 1.0 for its activities and object types.
- * Additional types are used for non standard activities.
- *
- * @var string
- * @see https://github.com/friendica/friendica/wiki/ActivityStreams
- */
- const DFRN = 'http://purl.org/macgirvin/dfrn/1.0';
- /**
- * This namespace defines an extension for expressing threaded
- * discussions within the Atom Syndication Format [RFC4287]
- *
- * @see https://tools.ietf.org/rfc/rfc4685.txt
- * @var string
- */
- const THREAD = 'http://purl.org/syndication/thread/1.0';
- /**
- * This namespace adds mechanisms to the Atom Syndication Format
- * that publishers of Atom Feed and Entry documents can use to
- * explicitly identify Atom entries that have been removed.
- *
- * @see https://tools.ietf.org/html/rfc6721
- * @var string
- */
- const TOMB = 'http://purl.org/atompub/tombstones/1.0';
- /**
- * This specification details a model for representing potential and completed activities
- * using the JSON format.
- *
- * @see https://www.w3.org/ns/activitystreams
- * @var string
- */
- const ACTIVITY2 = 'https://www.w3.org/ns/activitystreams#';
- /**
- * Atom Activities 1.0
- *
- * This namespace presents an XML format that allows activities on social objects
- * to be expressed within the Atom Syndication Format.
- *
- * @see http://activitystrea.ms/spec/1.0
- * @var string
- */
- const ACTIVITY = 'http://activitystrea.ms/spec/1.0/';
- /**
- * This namespace presents a base set of Object types and Verbs for use with Activity Streams.
- *
- * @see http://activitystrea.ms/head/activity-schema.html
- * @var string
- */
- const ACTIVITY_SCHEMA = 'http://activitystrea.ms/schema/1.0/';
- /**
- * Atom Media Extensions
- *
- * @var string
- */
- const MEDIA = 'http://purl.org/syndication/atommedia';
- /**
- * The Salmon Protocol is an open, simple, standards-based solution that lets
- * aggregators and sources unify the conversations.
- *
- * @see http://www.salmon-protocol.org/salmon-protocol-summary
- * @var string
- */
- const SALMON_ME = 'http://salmon-protocol.org/ns/magic-env';
- /**
- * OStatus is a minimal specification for distributed status updates or microblogging.
- *
- * @see https://ostatus.github.io/spec/OStatus%201.0%20Draft%202.html
- * @var string
- */
- const OSTATUSSUB = 'http://ostatus.org/schema/1.0/subscribe';
- /**
- * GeoRSS was designed as a lightweight, community driven way to extend existing feeds with geographic information.
- *
- * @see http://www.georss.org/
- * @var string
- */
- const GEORSS = 'http://www.georss.org/georss';
- /**
- * The Portable Contacts specification is designed to make it easier for developers
- * to give their users a secure way to access the address books and friends lists
- * they have built up all over the web.
- *
- * @see http://portablecontacts.net/draft-spec/
- * @var string
- */
- const POCO = 'http://portablecontacts.net/spec/1.0';
- /**
- * @var string
- */
- const FEED = 'http://schemas.google.com/g/2010#updates-from';
- /**
- * OStatus is a minimal specification for distributed status updates or microblogging.
- *
- * @see https://ostatus.github.io/spec/OStatus%201.0%20Draft%202.html
- * @var string
- */
- const OSTATUS = 'http://ostatus.org/schema/1.0';
- /**
- * @var string
- */
- const STATUSNET = 'http://status.net/schema/api/1/';
- /**
- * This namespace describes the Atom Activity Streams in RDF Vocabulary (AAIR),
- * defined as a dictionary of named properties and classes using W3C's RDF technology,
- * and specifically a mapping of the Atom Activity Streams work to RDF.
- *
- * @see http://xmlns.notu.be/aair/#RFC4287
- * @var string
- */
- const ATOM1 = 'http://www.w3.org/2005/Atom';
- /**
- * @var string
- */
- const MASTODON = 'http://mastodon.social/schema/1.0';
-}
--- /dev/null
+<?php
+
+namespace Friendica\Protocol\Activity;
+
+/**
+ * Activity namespaces constants
+ */
+final class ActivityNamespace
+{
+ /**
+ * Zot is a WebMTA which provides a decentralised identity and communications protocol using HTTPS/JSON.
+ *
+ * @var string
+ * @see https://zotlabs.org/page/zotlabs/specs+zot6+home
+ */
+ const ZOT = 'http://purl.org/zot';
+ /**
+ * Friendica is using ActivityStreams in version 1.0 for its activities and object types.
+ * Additional types are used for non standard activities.
+ *
+ * @var string
+ * @see https://github.com/friendica/friendica/wiki/ActivityStreams
+ */
+ const DFRN = 'http://purl.org/macgirvin/dfrn/1.0';
+ /**
+ * This namespace defines an extension for expressing threaded
+ * discussions within the Atom Syndication Format [RFC4287]
+ *
+ * @see https://tools.ietf.org/rfc/rfc4685.txt
+ * @var string
+ */
+ const THREAD = 'http://purl.org/syndication/thread/1.0';
+ /**
+ * This namespace adds mechanisms to the Atom Syndication Format
+ * that publishers of Atom Feed and Entry documents can use to
+ * explicitly identify Atom entries that have been removed.
+ *
+ * @see https://tools.ietf.org/html/rfc6721
+ * @var string
+ */
+ const TOMB = 'http://purl.org/atompub/tombstones/1.0';
+ /**
+ * This specification details a model for representing potential and completed activities
+ * using the JSON format.
+ *
+ * @see https://www.w3.org/ns/activitystreams
+ * @var string
+ */
+ const ACTIVITY2 = 'https://www.w3.org/ns/activitystreams#';
+ /**
+ * Atom Activities 1.0
+ *
+ * This namespace presents an XML format that allows activities on social objects
+ * to be expressed within the Atom Syndication Format.
+ *
+ * @see http://activitystrea.ms/spec/1.0
+ * @var string
+ */
+ const ACTIVITY = 'http://activitystrea.ms/spec/1.0/';
+ /**
+ * This namespace presents a base set of Object types and Verbs for use with Activity Streams.
+ *
+ * @see http://activitystrea.ms/head/activity-schema.html
+ * @var string
+ */
+ const ACTIVITY_SCHEMA = 'http://activitystrea.ms/schema/1.0/';
+ /**
+ * Atom Media Extensions
+ *
+ * @var string
+ */
+ const MEDIA = 'http://purl.org/syndication/atommedia';
+ /**
+ * The Salmon Protocol is an open, simple, standards-based solution that lets
+ * aggregators and sources unify the conversations.
+ *
+ * @see http://www.salmon-protocol.org/salmon-protocol-summary
+ * @var string
+ */
+ const SALMON_ME = 'http://salmon-protocol.org/ns/magic-env';
+ /**
+ * OStatus is a minimal specification for distributed status updates or microblogging.
+ *
+ * @see https://ostatus.github.io/spec/OStatus%201.0%20Draft%202.html
+ * @var string
+ */
+ const OSTATUSSUB = 'http://ostatus.org/schema/1.0/subscribe';
+ /**
+ * GeoRSS was designed as a lightweight, community driven way to extend existing feeds with geographic information.
+ *
+ * @see http://www.georss.org/
+ * @var string
+ */
+ const GEORSS = 'http://www.georss.org/georss';
+ /**
+ * The Portable Contacts specification is designed to make it easier for developers
+ * to give their users a secure way to access the address books and friends lists
+ * they have built up all over the web.
+ *
+ * @see http://portablecontacts.net/draft-spec/
+ * @var string
+ */
+ const POCO = 'http://portablecontacts.net/spec/1.0';
+ /**
+ * @var string
+ */
+ const FEED = 'http://schemas.google.com/g/2010#updates-from';
+ /**
+ * OStatus is a minimal specification for distributed status updates or microblogging.
+ *
+ * @see https://ostatus.github.io/spec/OStatus%201.0%20Draft%202.html
+ * @var string
+ */
+ const OSTATUS = 'http://ostatus.org/schema/1.0';
+ /**
+ * @var string
+ */
+ const STATUSNET = 'http://status.net/schema/api/1/';
+ /**
+ * This namespace describes the Atom Activity Streams in RDF Vocabulary (AAIR),
+ * defined as a dictionary of named properties and classes using W3C's RDF technology,
+ * and specifically a mapping of the Atom Activity Streams work to RDF.
+ *
+ * @see http://xmlns.notu.be/aair/#RFC4287
+ * @var string
+ */
+ const ATOM1 = 'http://www.w3.org/2005/Atom';
+ /**
+ * @var string
+ */
+ const MASTODON = 'http://mastodon.social/schema/1.0';
+}
* @see http://activitystrea.ms/head/activity-schema.html#bookmark
* @var string
*/
- const BOOKMARK = ANamespace::ACTIVITY_SCHEMA . 'bookmark';
+ const BOOKMARK = ActivityNamespace::ACTIVITY_SCHEMA . 'bookmark';
/**
* The "comment" object type represents a textual response to another object.
*
* @see http://activitystrea.ms/head/activity-schema.html#comment
* @var string
*/
- const COMMENT = ANamespace::ACTIVITY_SCHEMA . 'comment';
+ const COMMENT = ActivityNamespace::ACTIVITY_SCHEMA . 'comment';
/**
* The "comment" object type represents a textual response to another object.
* (Default type for items)
* @see http://activitystrea.ms/head/activity-schema.html#note
* @var string
*/
- const NOTE = ANamespace::ACTIVITY_SCHEMA . 'note';
+ const NOTE = ActivityNamespace::ACTIVITY_SCHEMA . 'note';
/**
* The "person" object type represents a user account.
*
* @see http://activitystrea.ms/head/activity-schema.html#person
* @var string
*/
- const PERSON = ANamespace::ACTIVITY_SCHEMA . 'person';
+ const PERSON = ActivityNamespace::ACTIVITY_SCHEMA . 'person';
/**
* The "image" object type represents a graphical image.
*
* @see http://activitystrea.ms/head/activity-schema.html#image
* @var string
*/
- const IMAGE = ANamespace::ACTIVITY_SCHEMA . 'image';
+ const IMAGE = ActivityNamespace::ACTIVITY_SCHEMA . 'image';
/**
* @var string
*/
- const PHOTO = ANamespace::ACTIVITY_SCHEMA . 'photo';
+ const PHOTO = ActivityNamespace::ACTIVITY_SCHEMA . 'photo';
/**
* The "video" object type represents video content,
* which usually consists of a motion picture track and an audio track.
* @see http://activitystrea.ms/head/activity-schema.html#video
* @var string
*/
- const VIDEO = ANamespace::ACTIVITY_SCHEMA . 'video';
+ const VIDEO = ActivityNamespace::ACTIVITY_SCHEMA . 'video';
/**
* @var string
*/
- const PROFILE_PHOTO = ANamespace::ACTIVITY_SCHEMA . 'profile-photo';
+ const PROFILE_PHOTO = ActivityNamespace::ACTIVITY_SCHEMA . 'profile-photo';
/**
* @var string
*/
- const ALBUM = ANamespace::ACTIVITY_SCHEMA . 'photo-album';
+ const ALBUM = ActivityNamespace::ACTIVITY_SCHEMA . 'photo-album';
/**
* The "event" object type represents an event that occurs in a certain place during a particular interval of time.
*
* @see http://activitystrea.ms/head/activity-schema.html#event
* @var string
*/
- const EVENT = ANamespace::ACTIVITY_SCHEMA . 'event';
+ const EVENT = ActivityNamespace::ACTIVITY_SCHEMA . 'event';
/**
* The "group" object type represents a grouping of objects in which member objects can join or leave.
*
* @see http://activitystrea.ms/head/activity-schema.html#group
* @var string
*/
- const GROUP = ANamespace::ACTIVITY_SCHEMA . 'group';
+ const GROUP = ActivityNamespace::ACTIVITY_SCHEMA . 'group';
/**
* @var string
*/
- const HEART = ANamespace::DFRN . '/heart';
+ const HEART = ActivityNamespace::DFRN . '/heart';
/**
* @var string
*/
- const TAGTERM = ANamespace::DFRN . '/tagterm';
+ const TAGTERM = ActivityNamespace::DFRN . '/tagterm';
/**
* @var string
*/
- const PROFILE = ANamespace::DFRN . '/profile';
+ const PROFILE = ActivityNamespace::DFRN . '/profile';
/**
use Friendica\Model\User;
use Friendica\Network\Probe;
use Friendica\Object\Image;
-use Friendica\Protocol\Activity\ANamespace;
+use Friendica\Protocol\Activity\ActivityNamespace;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
$type = 'html';
if ($conversation) {
- $root = $doc->createElementNS(ANamespace::ATOM1, 'feed');
+ $root = $doc->createElementNS(ActivityNamespace::ATOM1, 'feed');
$doc->appendChild($root);
- $root->setAttribute("xmlns:thr", ANamespace::THREAD);
- $root->setAttribute("xmlns:at", ANamespace::TOMB);
- $root->setAttribute("xmlns:media", ANamespace::MEDIA);
- $root->setAttribute("xmlns:dfrn", ANamespace::DFRN);
- $root->setAttribute("xmlns:activity", ANamespace::ACTIVITY);
- $root->setAttribute("xmlns:georss", ANamespace::GEORSS);
- $root->setAttribute("xmlns:poco", ANamespace::POCO);
- $root->setAttribute("xmlns:ostatus", ANamespace::OSTATUS);
- $root->setAttribute("xmlns:statusnet", ANamespace::STATUSNET);
+ $root->setAttribute("xmlns:thr", ActivityNamespace::THREAD);
+ $root->setAttribute("xmlns:at", ActivityNamespace::TOMB);
+ $root->setAttribute("xmlns:media", ActivityNamespace::MEDIA);
+ $root->setAttribute("xmlns:dfrn", ActivityNamespace::DFRN);
+ $root->setAttribute("xmlns:activity", ActivityNamespace::ACTIVITY);
+ $root->setAttribute("xmlns:georss", ActivityNamespace::GEORSS);
+ $root->setAttribute("xmlns:poco", ActivityNamespace::POCO);
+ $root->setAttribute("xmlns:ostatus", ActivityNamespace::OSTATUS);
+ $root->setAttribute("xmlns:statusnet", ActivityNamespace::STATUSNET);
//$root = self::addHeader($doc, $owner, "dfrn:owner", "", false);
$alternatelink = $owner['url'];
}
- $root = $doc->createElementNS(ANamespace::ATOM1, 'feed');
+ $root = $doc->createElementNS(ActivityNamespace::ATOM1, 'feed');
$doc->appendChild($root);
- $root->setAttribute("xmlns:thr", ANamespace::THREAD);
- $root->setAttribute("xmlns:at", ANamespace::TOMB);
- $root->setAttribute("xmlns:media", ANamespace::MEDIA);
- $root->setAttribute("xmlns:dfrn", ANamespace::DFRN);
- $root->setAttribute("xmlns:activity", ANamespace::ACTIVITY);
- $root->setAttribute("xmlns:georss", ANamespace::GEORSS);
- $root->setAttribute("xmlns:poco", ANamespace::POCO);
- $root->setAttribute("xmlns:ostatus", ANamespace::OSTATUS);
- $root->setAttribute("xmlns:statusnet", ANamespace::STATUSNET);
+ $root->setAttribute("xmlns:thr", ActivityNamespace::THREAD);
+ $root->setAttribute("xmlns:at", ActivityNamespace::TOMB);
+ $root->setAttribute("xmlns:media", ActivityNamespace::MEDIA);
+ $root->setAttribute("xmlns:dfrn", ActivityNamespace::DFRN);
+ $root->setAttribute("xmlns:activity", ActivityNamespace::ACTIVITY);
+ $root->setAttribute("xmlns:georss", ActivityNamespace::GEORSS);
+ $root->setAttribute("xmlns:poco", ActivityNamespace::POCO);
+ $root->setAttribute("xmlns:ostatus", ActivityNamespace::OSTATUS);
+ $root->setAttribute("xmlns:statusnet", ActivityNamespace::STATUSNET);
XML::addElement($doc, $root, "id", System::baseUrl()."/profile/".$owner["nick"]);
XML::addElement($doc, $root, "title", $owner["name"]);
if (!$single) {
$entry = $doc->createElement("entry");
} else {
- $entry = $doc->createElementNS(ANamespace::ATOM1, 'entry');
+ $entry = $doc->createElementNS(ActivityNamespace::ATOM1, 'entry');
$doc->appendChild($entry);
- $entry->setAttribute("xmlns:thr", ANamespace::THREAD);
- $entry->setAttribute("xmlns:at", ANamespace::TOMB);
- $entry->setAttribute("xmlns:media", ANamespace::MEDIA);
- $entry->setAttribute("xmlns:dfrn", ANamespace::DFRN);
- $entry->setAttribute("xmlns:activity", ANamespace::ACTIVITY);
- $entry->setAttribute("xmlns:georss", ANamespace::GEORSS);
- $entry->setAttribute("xmlns:poco", ANamespace::POCO);
- $entry->setAttribute("xmlns:ostatus", ANamespace::OSTATUS);
- $entry->setAttribute("xmlns:statusnet", ANamespace::STATUSNET);
+ $entry->setAttribute("xmlns:thr", ActivityNamespace::THREAD);
+ $entry->setAttribute("xmlns:at", ActivityNamespace::TOMB);
+ $entry->setAttribute("xmlns:media", ActivityNamespace::MEDIA);
+ $entry->setAttribute("xmlns:dfrn", ActivityNamespace::DFRN);
+ $entry->setAttribute("xmlns:activity", ActivityNamespace::ACTIVITY);
+ $entry->setAttribute("xmlns:georss", ActivityNamespace::GEORSS);
+ $entry->setAttribute("xmlns:poco", ActivityNamespace::POCO);
+ $entry->setAttribute("xmlns:ostatus", ActivityNamespace::OSTATUS);
+ $entry->setAttribute("xmlns:statusnet", ActivityNamespace::STATUSNET);
}
if ($item['private']) {
$obj_doc = new DOMDocument("1.0", "utf-8");
$obj_doc->formatOutput = true;
- $obj_element = $obj_doc->createElementNS( ANamespace::ATOM1, $element);
+ $obj_element = $obj_doc->createElementNS( ActivityNamespace::ATOM1, $element);
$activity_type = $xpath->query("activity:object-type/text()", $activity)->item(0)->nodeValue;
XML::addElement($obj_doc, $obj_element, "type", $activity_type);
@$doc->loadXML($xml);
$xpath = new DOMXPath($doc);
- $xpath->registerNamespace("atom", ANamespace::ATOM1);
- $xpath->registerNamespace("thr", ANamespace::THREAD);
- $xpath->registerNamespace("at", ANamespace::TOMB);
- $xpath->registerNamespace("media", ANamespace::MEDIA);
- $xpath->registerNamespace("dfrn", ANamespace::DFRN);
- $xpath->registerNamespace("activity", ANamespace::ACTIVITY);
- $xpath->registerNamespace("georss", ANamespace::GEORSS);
- $xpath->registerNamespace("poco", ANamespace::POCO);
- $xpath->registerNamespace("ostatus", ANamespace::OSTATUS);
- $xpath->registerNamespace("statusnet", ANamespace::STATUSNET);
+ $xpath->registerNamespace("atom", ActivityNamespace::ATOM1);
+ $xpath->registerNamespace("thr", ActivityNamespace::THREAD);
+ $xpath->registerNamespace("at", ActivityNamespace::TOMB);
+ $xpath->registerNamespace("media", ActivityNamespace::MEDIA);
+ $xpath->registerNamespace("dfrn", ActivityNamespace::DFRN);
+ $xpath->registerNamespace("activity", ActivityNamespace::ACTIVITY);
+ $xpath->registerNamespace("georss", ActivityNamespace::GEORSS);
+ $xpath->registerNamespace("poco", ActivityNamespace::POCO);
+ $xpath->registerNamespace("ostatus", ActivityNamespace::OSTATUS);
+ $xpath->registerNamespace("statusnet", ActivityNamespace::STATUSNET);
$header = [];
$header["uid"] = $importer["importer_uid"];
use Friendica\Model\Profile;
use Friendica\Model\User;
use Friendica\Network\Probe;
-use Friendica\Protocol\Activity\ANamespace;
+use Friendica\Protocol\Activity\ActivityNamespace;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Map;
}
}
- $base = $basedom->children(ANamespace::SALMON_ME);
+ $base = $basedom->children(ActivityNamespace::SALMON_ME);
// Not sure if this cleaning is needed
$data = str_replace([" ", "\t", "\r", "\n"], ["", "", "", ""], $base->data);
$author_link = str_replace('acct:', '', $idom->author_id);
}
- $dom = $basedom->children(ANamespace::SALMON_ME);
+ $dom = $basedom->children(ActivityNamespace::SALMON_ME);
// figure out where in the DOM tree our data is hiding
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Item;
-use Friendica\Protocol\Activity\ANamespace;
+use Friendica\Protocol\Activity\ActivityNamespace;
use Friendica\Util\Network;
use Friendica\Util\XML;
$doc = new DOMDocument();
@$doc->loadXML(trim($xml));
$xpath = new DOMXPath($doc);
- $xpath->registerNamespace('atom', ANamespace::ATOM1);
+ $xpath->registerNamespace('atom', ActivityNamespace::ATOM1);
$xpath->registerNamespace('dc', "http://purl.org/dc/elements/1.1/");
$xpath->registerNamespace('content', "http://purl.org/rss/1.0/modules/content/");
$xpath->registerNamespace('rdf', "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
$xpath->registerNamespace('rss', "http://purl.org/rss/1.0/");
$xpath->registerNamespace('media', "http://search.yahoo.com/mrss/");
- $xpath->registerNamespace('poco', ANamespace::POCO);
+ $xpath->registerNamespace('poco', ActivityNamespace::POCO);
$author = [];
$entries = null;
use Friendica\Model\User;
use Friendica\Network\Probe;
use Friendica\Object\Image;
-use Friendica\Protocol\Activity\ANamespace;
+use Friendica\Protocol\Activity\ActivityNamespace;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils;
@$doc->loadXML($xml);
$xpath = new DOMXPath($doc);
- $xpath->registerNamespace('atom', ANamespace::ATOM1);
- $xpath->registerNamespace('thr', ANamespace::THREAD);
- $xpath->registerNamespace('georss', ANamespace::GEORSS);
- $xpath->registerNamespace('activity', ANamespace::ACTIVITY);
- $xpath->registerNamespace('media', ANamespace::MEDIA);
- $xpath->registerNamespace('poco', ANamespace::POCO);
- $xpath->registerNamespace('ostatus', ANamespace::OSTATUS);
- $xpath->registerNamespace('statusnet', ANamespace::STATUSNET);
+ $xpath->registerNamespace('atom', ActivityNamespace::ATOM1);
+ $xpath->registerNamespace('thr', ActivityNamespace::THREAD);
+ $xpath->registerNamespace('georss', ActivityNamespace::GEORSS);
+ $xpath->registerNamespace('activity', ActivityNamespace::ACTIVITY);
+ $xpath->registerNamespace('media', ActivityNamespace::MEDIA);
+ $xpath->registerNamespace('poco', ActivityNamespace::POCO);
+ $xpath->registerNamespace('ostatus', ActivityNamespace::OSTATUS);
+ $xpath->registerNamespace('statusnet', ActivityNamespace::STATUSNET);
$contact = ["id" => 0];
@$doc->loadXML($xml);
$xpath = new DOMXPath($doc);
- $xpath->registerNamespace('atom', ANamespace::ATOM1);
- $xpath->registerNamespace('thr', ANamespace::THREAD);
- $xpath->registerNamespace('georss', ANamespace::GEORSS);
- $xpath->registerNamespace('activity', ANamespace::ACTIVITY);
- $xpath->registerNamespace('media', ANamespace::MEDIA);
- $xpath->registerNamespace('poco', ANamespace::POCO);
- $xpath->registerNamespace('ostatus', ANamespace::OSTATUS);
- $xpath->registerNamespace('statusnet', ANamespace::STATUSNET);
+ $xpath->registerNamespace('atom', ActivityNamespace::ATOM1);
+ $xpath->registerNamespace('thr', ActivityNamespace::THREAD);
+ $xpath->registerNamespace('georss', ActivityNamespace::GEORSS);
+ $xpath->registerNamespace('activity', ActivityNamespace::ACTIVITY);
+ $xpath->registerNamespace('media', ActivityNamespace::MEDIA);
+ $xpath->registerNamespace('poco', ActivityNamespace::POCO);
+ $xpath->registerNamespace('ostatus', ActivityNamespace::OSTATUS);
+ $xpath->registerNamespace('statusnet', ActivityNamespace::STATUSNET);
$hub = "";
$hub_items = $xpath->query("/atom:feed/atom:link[@rel='hub']")->item(0);
@$doc->loadXML($xml);
$xpath = new DOMXPath($doc);
- $xpath->registerNamespace('atom', ANamespace::ATOM1);
- $xpath->registerNamespace('thr', ANamespace::THREAD);
- $xpath->registerNamespace('ostatus', ANamespace::OSTATUS);
+ $xpath->registerNamespace('atom', ActivityNamespace::ATOM1);
+ $xpath->registerNamespace('thr', ActivityNamespace::THREAD);
+ $xpath->registerNamespace('ostatus', ActivityNamespace::OSTATUS);
$entries = $xpath->query('/atom:feed/atom:entry');
*/
private static function addHeader(DOMDocument $doc, array $owner, $filter, $feed_mode = false)
{
- $root = $doc->createElementNS(ANamespace::ATOM1, 'feed');
+ $root = $doc->createElementNS(ActivityNamespace::ATOM1, 'feed');
$doc->appendChild($root);
- $root->setAttribute("xmlns:thr", ANamespace::THREAD);
- $root->setAttribute("xmlns:georss", ANamespace::GEORSS);
- $root->setAttribute("xmlns:activity", ANamespace::ACTIVITY);
- $root->setAttribute("xmlns:media", ANamespace::MEDIA);
- $root->setAttribute("xmlns:poco", ANamespace::POCO);
- $root->setAttribute("xmlns:ostatus", ANamespace::OSTATUS);
- $root->setAttribute("xmlns:statusnet", ANamespace::STATUSNET);
- $root->setAttribute("xmlns:mastodon", ANamespace::MASTODON);
+ $root->setAttribute("xmlns:thr", ActivityNamespace::THREAD);
+ $root->setAttribute("xmlns:georss", ActivityNamespace::GEORSS);
+ $root->setAttribute("xmlns:activity", ActivityNamespace::ACTIVITY);
+ $root->setAttribute("xmlns:media", ActivityNamespace::MEDIA);
+ $root->setAttribute("xmlns:poco", ActivityNamespace::POCO);
+ $root->setAttribute("xmlns:ostatus", ActivityNamespace::OSTATUS);
+ $root->setAttribute("xmlns:statusnet", ActivityNamespace::STATUSNET);
+ $root->setAttribute("xmlns:mastodon", ActivityNamespace::MASTODON);
$title = '';
$selfUri = '/feed/' . $owner["nick"] . '/';
$as_object = $doc->createElement("activity:object");
- XML::addElement($doc, $as_object, "activity:object-type", ANamespace::ACTIVITY_SCHEMA . "activity");
+ XML::addElement($doc, $as_object, "activity:object-type", ActivityNamespace::ACTIVITY_SCHEMA . "activity");
self::entryContent($doc, $as_object, $repeated_item, $owner, "", "", false);
$entry = self::entryHeader($doc, $owner, $item, $toplevel);
- $verb = Activity\ANamespace::ACTIVITY_SCHEMA . "favorite";
+ $verb = Activity\ActivityNamespace::ACTIVITY_SCHEMA . "favorite";
self::entryContent($doc, $entry, $item, $owner, "Favorite", $verb, false);
$parent = Item::selectFirst([], ['uri' => $item["thr-parent"], 'uid' => $item["uid"]]);
$entry->appendChild($author);
}
} else {
- $entry = $doc->createElementNS(ANamespace::ATOM1, "entry");
-
- $entry->setAttribute("xmlns:thr", ANamespace::THREAD);
- $entry->setAttribute("xmlns:georss", ANamespace::GEORSS);
- $entry->setAttribute("xmlns:activity", ANamespace::ACTIVITY);
- $entry->setAttribute("xmlns:media", ANamespace::MEDIA);
- $entry->setAttribute("xmlns:poco", ANamespace::POCO);
- $entry->setAttribute("xmlns:ostatus", ANamespace::OSTATUS);
- $entry->setAttribute("xmlns:statusnet", ANamespace::STATUSNET);
- $entry->setAttribute("xmlns:mastodon", ANamespace::MASTODON);
+ $entry = $doc->createElementNS(ActivityNamespace::ATOM1, "entry");
+
+ $entry->setAttribute("xmlns:thr", ActivityNamespace::THREAD);
+ $entry->setAttribute("xmlns:georss", ActivityNamespace::GEORSS);
+ $entry->setAttribute("xmlns:activity", ActivityNamespace::ACTIVITY);
+ $entry->setAttribute("xmlns:media", ActivityNamespace::MEDIA);
+ $entry->setAttribute("xmlns:poco", ActivityNamespace::POCO);
+ $entry->setAttribute("xmlns:ostatus", ActivityNamespace::OSTATUS);
+ $entry->setAttribute("xmlns:statusnet", ActivityNamespace::STATUSNET);
+ $entry->setAttribute("xmlns:mastodon", ActivityNamespace::MASTODON);
$author = self::addAuthor($doc, $owner);
$entry->appendChild($author);
],
'withNamespace' => [
'haystack' => 'tagterm',
- 'needle' => Activity\ANamespace::ACTIVITY_SCHEMA . Activity\ObjectType::TAGTERM,
+ 'needle' => Activity\ActivityNamespace::ACTIVITY_SCHEMA . Activity\ObjectType::TAGTERM,
'assert' => true,
],
'invalidSimple' => [
],
'withSubPath' => [
'haystack' => 'tagterm',
- 'needle' => Activity\ANamespace::ACTIVITY_SCHEMA . '/bla/' . Activity\ObjectType::TAGTERM,
+ 'needle' => Activity\ActivityNamespace::ACTIVITY_SCHEMA . '/bla/' . Activity\ObjectType::TAGTERM,
'assert' => true,
],
];