]> git.mxchange.org Git - friendica.git/commitdiff
Renamed to ActivityNamespace
authorPhilipp Holzer <admin+github@philipp.info>
Thu, 24 Oct 2019 22:32:35 +0000 (00:32 +0200)
committerPhilipp Holzer <admin+github@philipp.info>
Thu, 24 Oct 2019 22:32:35 +0000 (00:32 +0200)
12 files changed:
mod/salmon.php
src/Module/Xrd.php
src/Network/Probe.php
src/Protocol/Activity.php
src/Protocol/Activity/ANamespace.php [deleted file]
src/Protocol/Activity/ActivityNamespace.php [new file with mode: 0644]
src/Protocol/Activity/ObjectType.php
src/Protocol/DFRN.php
src/Protocol/Diaspora.php
src/Protocol/Feed.php
src/Protocol/OStatus.php
tests/src/Protocol/ActivityTest.php

index 9a6d0864aaf250ee75d5f6baf2377a8fdc3b16ea..2a7c4a4b3d265d34baee39ba366680a39c40da51 100644 (file)
@@ -9,7 +9,7 @@ use Friendica\Core\PConfig;
 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;
@@ -37,7 +37,7 @@ function salmon_post(App $a, $xml = '') {
 
        // 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;
 
index a28d1eed2487c3a7ff6a4a0da6c10d10ceaf3280..77fa3959a59e78c7755f6589e7d4aefacdee69a5 100644 (file)
@@ -8,7 +8,7 @@ use Friendica\Core\Renderer;
 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;
 
@@ -95,11 +95,11 @@ class Xrd extends BaseModule
                        ],
                        'links'   => [
                                [
-                                       'rel'  => ANamespace::DFRN ,
+                                       'rel'  => ActivityNamespace::DFRN ,
                                        'href' => $owner['url'],
                                ],
                                [
-                                       'rel'  => ANamespace::FEED,
+                                       'rel'  => ActivityNamespace::FEED,
                                        'type' => 'application/atom+xml',
                                        'href' => $owner['poll'],
                                ],
@@ -119,7 +119,7 @@ class Xrd extends BaseModule
                                        'href' => $baseURL . '/hcard/' . $owner['nickname'],
                                ],
                                [
-                                       'rel'  => ANamespace::POCO,
+                                       'rel'  => ActivityNamespace::POCO,
                                        'href' => $owner['poco'],
                                ],
                                [
index 0014fa05d361aff9e8eef7976cfa845e71fcded8..e63224411fba558f2f9c35349ba928385c0e7298 100644 (file)
@@ -18,7 +18,7 @@ use Friendica\Core\Protocol;
 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;
@@ -200,10 +200,10 @@ class Probe
                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') {
@@ -492,7 +492,7 @@ class Probe
                $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') {
@@ -955,15 +955,15 @@ class Probe
                // 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"];
@@ -1171,9 +1171,9 @@ class Probe
                                $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"];
@@ -1273,7 +1273,7 @@ class Probe
                                        $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"];
index 83e0327525d9cb86e92ed19fa33300ae6dcf3ddd..d2c5eec4b3a74abfccb7339030b77b3908df9381 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Friendica\Protocol;
 
-use Friendica\Protocol\Activity\ANamespace;
+use Friendica\Protocol\Activity\ActivityNamespace;
 
 /**
  * Base class for the Activity Verbs
@@ -15,14 +15,14 @@ final class Activity
         * @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
@@ -30,21 +30,21 @@ final class Activity
         * @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.
@@ -52,98 +52,98 @@ final class Activity
         * @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.
@@ -151,11 +151,11 @@ final class Activity
         * @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,
@@ -200,6 +200,6 @@ final class Activity
        {
                return (($haystack === $needle) ||
                        ((basename($needle) === $haystack) &&
-                        strstr($needle, ANamespace::ACTIVITY_SCHEMA)));
+                        strstr($needle, ActivityNamespace::ACTIVITY_SCHEMA)));
        }
 }
diff --git a/src/Protocol/Activity/ANamespace.php b/src/Protocol/Activity/ANamespace.php
deleted file mode 100644 (file)
index 55fcc83..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-<?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';
-}
diff --git a/src/Protocol/Activity/ActivityNamespace.php b/src/Protocol/Activity/ActivityNamespace.php
new file mode 100644 (file)
index 0000000..a821f06
--- /dev/null
@@ -0,0 +1,132 @@
+<?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';
+}
index 71c7a215766b1041e0230870e5779810489044e9..7bed40d87d17d2688bd5342aab3dde59e6320c8d 100644 (file)
@@ -13,14 +13,14 @@ final class ObjectType
         * @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)
@@ -28,25 +28,25 @@ final class ObjectType
         * @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.
@@ -54,43 +54,43 @@ final class ObjectType
         * @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';
 
 
        /**
index 6bf3e6e4fa301576ada320784126f700c84b5d1a..6e84fdbb345c377ec547086e5b971efece5c1412 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Model\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;
@@ -381,18 +381,18 @@ class DFRN
                $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);
 
@@ -556,18 +556,18 @@ class DFRN
                        $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"]);
@@ -940,18 +940,18 @@ class DFRN
                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']) {
@@ -1749,7 +1749,7 @@ class DFRN
                $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);
@@ -2730,16 +2730,16 @@ class DFRN
                @$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"];
index 709dfa02fdff0d0537f2f577dd1f6f5a380ce8f6..6fcfa36bdb2e9217a88321350be3ae0da343ed15 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Model\Mail;
 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;
@@ -466,7 +466,7 @@ class Diaspora
                        }
                }
 
-               $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);
@@ -578,7 +578,7 @@ class Diaspora
                        $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
 
index 816820bc4a56236613a918491f80c34d2814dd0b..31f54e50c5e9aa720a20e7af431afc1021cc3792 100644 (file)
@@ -14,7 +14,7 @@ use Friendica\Core\Protocol;
 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;
 
@@ -60,13 +60,13 @@ class Feed {
                $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;
index d0f7d7edf2308af6cecae2229058f393c3ac30a4..9a41920ae8378f12fafbb19e05a49fe3d49b9673 100644 (file)
@@ -25,7 +25,7 @@ use Friendica\Model\Item;
 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;
@@ -262,14 +262,14 @@ class OStatus
                @$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];
 
@@ -343,14 +343,14 @@ class OStatus
                @$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);
@@ -804,9 +804,9 @@ class OStatus
                @$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');
 
@@ -1282,17 +1282,17 @@ class OStatus
         */
        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"] . '/';
@@ -1710,7 +1710,7 @@ class OStatus
 
                $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);
 
@@ -1760,7 +1760,7 @@ class OStatus
 
                $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"]]);
@@ -1951,16 +1951,16 @@ class OStatus
                                $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);
index ac332a7f79eb0c9c020ba7201ef58f16d7ec7658..5249ebefafdc0595ad90ce4179b4f4b9cff1932f 100644 (file)
@@ -22,7 +22,7 @@ class ActivityTest extends MockedTest
                        ],
                        'withNamespace' => [
                                'haystack' => 'tagterm',
-                               'needle' => Activity\ANamespace::ACTIVITY_SCHEMA . Activity\ObjectType::TAGTERM,
+                               'needle' => Activity\ActivityNamespace::ACTIVITY_SCHEMA . Activity\ObjectType::TAGTERM,
                                'assert' => true,
                        ],
                        'invalidSimple' => [
@@ -37,7 +37,7 @@ class ActivityTest extends MockedTest
                        ],
                        'withSubPath' => [
                                'haystack' => 'tagterm',
-                               'needle' => Activity\ANamespace::ACTIVITY_SCHEMA . '/bla/' . Activity\ObjectType::TAGTERM,
+                               'needle' => Activity\ActivityNamespace::ACTIVITY_SCHEMA . '/bla/' . Activity\ObjectType::TAGTERM,
                                'assert' => true,
                        ],
                ];