summaryrefslogtreecommitdiffstats
path: root/lib/Model
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-01-21 15:10:41 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-01-24 10:50:03 -0100
commit2081e9b3a564dbca19e0d4151ba32e60978f52e3 (patch)
tree1c3e553ec651c72a8641af7d34e5330dc1dc94dc /lib/Model
parent393e73f7e295c737c8c880405a3c0f4984f92c4b (diff)
Model and Interface: Announce
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Model')
-rw-r--r--lib/Model/ActivityPub/Object/Announce.php96
1 files changed, 96 insertions, 0 deletions
diff --git a/lib/Model/ActivityPub/Object/Announce.php b/lib/Model/ActivityPub/Object/Announce.php
new file mode 100644
index 00000000..ede50958
--- /dev/null
+++ b/lib/Model/ActivityPub/Object/Announce.php
@@ -0,0 +1,96 @@
+<?php
+declare(strict_types=1);
+
+
+/**
+ * Nextcloud - Social Support
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Maxence Lange <maxence@artificial-owl.com>
+ * @copyright 2018, Maxence Lange <maxence@artificial-owl.com>
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+namespace OCA\Social\Model\ActivityPub\Object;
+
+
+use JsonSerializable;
+use OCA\Social\Model\ActivityPub\ACore;
+
+
+/**
+ * Class Follow
+ *
+ * @package OCA\Social\Model\ActivityPub\Object
+ */
+class Announce extends ACore implements JsonSerializable {
+
+
+ const TYPE = 'Announce';
+
+
+
+
+ /**
+ * Follow constructor.
+ *
+ * @param ACore $parent
+ */
+ public function __construct($parent = null) {
+ parent::__construct($parent);
+
+ $this->setType(self::TYPE);
+ }
+
+
+ /**
+ * @param array $data
+ */
+ public function import(array $data) {
+ parent::import($data);
+ }
+
+
+ /**
+ * @param array $data
+ */
+ public function importFromDatabase(array $data) {
+ parent::importFromDatabase($data);
+ }
+
+
+ /**
+ * @return array
+ */
+ public function jsonSerialize(): array {
+ $result = parent::jsonSerialize();
+
+ if ($this->isCompleteDetails()) {
+ array_merge(
+ $result,
+ []
+ );
+ }
+
+ return $result;
+ }
+
+}
+