]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Activity.php
database.sql updated, standards fixed
[friendica.git] / src / Protocol / Activity.php
index bba7909fdf062f2eca6549eb7c080ba86691b6e2..0f15e851c3df8ee3a5ec7900bcceffb27f68d040 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -176,6 +176,20 @@ final class Activity
        const O_UNFOLLOW    = ActivityNamespace::OSTATUS . '/unfollow';
        const O_UNFAVOURITE = ActivityNamespace::OSTATUS . '/unfavorite';
 
+       /**
+        * React to a post via an emoji 
+        *
+        * @var string
+        */
+       const EMOJIREACT = ActivityNamespace::LITEPUB . '/emojireact';
+
+       /**
+        * View notification from Peertube
+        *
+        * @var string
+        */
+       const VIEW       = ActivityNamespace::PEERTUBE . '/view';
+
        /**
         * likes (etc.) can apply to other things besides posts. Check if they are post children,
         * in which case we handle them specially
@@ -183,10 +197,12 @@ final class Activity
         * Hidden activities, which doesn't need to be shown
         */
        const HIDDEN_ACTIVITIES = [
-               Activity::LIKE, Activity::DISLIKE,
-               Activity::ATTEND, Activity::ATTENDNO, Activity::ATTENDMAYBE,
-               Activity::FOLLOW,
-               Activity::ANNOUNCE,
+               self::LIKE, self::DISLIKE,
+               self::ATTEND, self::ATTENDNO, self::ATTENDMAYBE,
+               self::FOLLOW,
+               self::ANNOUNCE,
+               self::EMOJIREACT,
+               self::VIEW,
        ];
 
        /**
@@ -196,7 +212,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)) {
@@ -215,7 +231,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) &&