]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Activity.php
make errormessages modular and better
[friendica.git] / src / Protocol / Activity.php
index 637669a61e8bc7acd3744db6f87c224d0e954687..36bc5e99b384008b60eebcc11ca0330d64fadd4c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -163,21 +163,33 @@ final class Activity
         * @var string
         */
        const ANNOUNCE   = ActivityNamespace::ACTIVITY2 . 'Announce';
-
        /**
-        * Pokes an user.
+        * Indicates that the actor has read the object.
         *
-        * @see https://github.com/friendica/friendica/wiki/ActivityStreams#activity_poke
+        * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-read
         * @var string
         */
-       const POKE       = ActivityNamespace::ZOT . '/activity/poke';
-
+       const READ       = ActivityNamespace::ACTIVITY2 . 'Read';
+       /**
+        *  Indicates that the actor has listened to the object. 
+        *
+        * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-listen
+        * @var string
+        */
+       const LISTEN     = ActivityNamespace::ACTIVITY2 . 'Listen';
+       /**
+        * Indicates that the actor has viewed the object.
+        *
+        * @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-view
+        * @var string
+        */
+       const VIEW       = ActivityNamespace::ACTIVITY2 . 'View';
 
        const O_UNFOLLOW    = ActivityNamespace::OSTATUS . '/unfollow';
        const O_UNFAVOURITE = ActivityNamespace::OSTATUS . '/unfavorite';
 
        /**
-        * React to a post via an emoji 
+        * React to a post via an emoji
         *
         * @var string
         */
@@ -195,6 +207,8 @@ final class Activity
                self::FOLLOW,
                self::ANNOUNCE,
                self::EMOJIREACT,
+               self::VIEW,
+               self::READ,
        ];
 
        /**
@@ -204,7 +218,7 @@ final class Activity
         *
         * @return bool True, if the activity is hidden
         */
-       public function isHidden(string $activity)
+       public function isHidden(string $activity): bool
        {
                foreach (self::HIDDEN_ACTIVITIES as $hiddenActivity) {
                        if ($this->match($activity, $hiddenActivity)) {
@@ -223,7 +237,7 @@ final class Activity
         *
         * @return boolean
         */
-       public function match(string $haystack, string $needle)
+       public function match(string $haystack, string $needle): bool
        {
                return (($haystack === $needle) ||
                        ((basename($needle) === $haystack) &&