summaryrefslogtreecommitdiffstats
path: root/lib/Model/ActivityPub/Stream.php
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-05-17 16:33:21 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-05-17 16:33:21 -0100
commitecdf7e6cf656c22656e8071c7c0f517efbf4ec1d (patch)
tree25ab753fdd49f3d9455ed4bf134eb5f7996c69dd /lib/Model/ActivityPub/Stream.php
parent8f1f3a41b65b22470f4e50b4d4fecde71639a90a (diff)
+filterHiddenOnTimeline()
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model/ActivityPub/Stream.php')
-rw-r--r--lib/Model/ActivityPub/Stream.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Model/ActivityPub/Stream.php b/lib/Model/ActivityPub/Stream.php
index 6fdfee08..8c40d0bf 100644
--- a/lib/Model/ActivityPub/Stream.php
+++ b/lib/Model/ActivityPub/Stream.php
@@ -74,6 +74,9 @@ class Stream extends ACore implements JsonSerializable {
/** @var StreamAction */
private $action = null;
+ /** @var bool */
+ private $hiddenOnTimeline = false;
+
public function __construct($parent = null) {
parent::__construct($parent);
@@ -289,6 +292,25 @@ class Stream extends ACore implements JsonSerializable {
/**
+ * @return bool
+ */
+ public function isHiddenOnTimeline(): bool {
+ return $this->hiddenOnTimeline;
+ }
+
+ /**
+ * @param bool $hiddenOnTimeline
+ *
+ * @return Stream
+ */
+ public function setHiddenOnTimeline(bool $hiddenOnTimeline): Stream {
+ $this->hiddenOnTimeline = $hiddenOnTimeline;
+
+ return $this;
+ }
+
+
+ /**
* @param array $data
*/
public function import(array $data) {
@@ -321,6 +343,7 @@ class Stream extends ACore implements JsonSerializable {
$this->setObjectId($this->validate(self::AS_ID, 'object_id', $data, ''));
$this->setAttributedTo($this->validate(self::AS_ID, 'attributed_to', $data, ''));
$this->setInReplyTo($this->validate(self::AS_ID, 'in_reply_to', $data));
+ $this->setHiddenOnTimeline($this->getBool('hidden_on_timeline', $data, false));
$cache = new Cache();
$cache->import($this->getArray('cache', $data, []));