X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivity.php;h=36bc5e99b384008b60eebcc11ca0330d64fadd4c;hb=ec16e7c0e6349d7080f634177ef943b446be3735;hp=bea2dedb096c5675e06b3c9b5a5864da2f476ca0;hpb=b632114b12ec9a160d5442419c21a068c2eb472b;p=friendica.git diff --git a/src/Protocol/Activity.php b/src/Protocol/Activity.php index bea2dedb09..36bc5e99b3 100644 --- a/src/Protocol/Activity.php +++ b/src/Protocol/Activity.php @@ -1,4 +1,23 @@ . + * + */ namespace Friendica\Protocol; @@ -144,19 +163,38 @@ 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 + * + * @var string + */ + const EMOJIREACT = ActivityNamespace::LITEPUB . '/emojireact'; + /** * likes (etc.) can apply to other things besides posts. Check if they are post children, * in which case we handle them specially @@ -164,10 +202,13 @@ 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, + self::READ, ]; /** @@ -177,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)) { @@ -196,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) &&