summaryrefslogtreecommitdiffstats
path: root/lib/AP.php
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-12-29 12:49:31 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-05-03 20:54:14 -0100
commit27a4785650f0d571ca97fb5ad832ee8cdb817e47 (patch)
tree43798ead6f7c3c3a7f2e32c1ce8b14c826f86712 /lib/AP.php
parent35c4827f83a356012f800e903c86b54be43a98d5 (diff)
managing Notifications in the notification steam
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/AP.php')
-rw-r--r--lib/AP.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/AP.php b/lib/AP.php
index 7d8ae585..02775f55 100644
--- a/lib/AP.php
+++ b/lib/AP.php
@@ -48,6 +48,7 @@ use OCA\Social\Interfaces\Activity\UndoInterface;
use OCA\Social\Interfaces\Activity\UpdateInterface;
use OCA\Social\Interfaces\Actor\PersonInterface;
use OCA\Social\Interfaces\IActivityPubInterface;
+use OCA\Social\Interfaces\Internal\SocialAppNotificationInterface;
use OCA\Social\Interfaces\Object\DocumentInterface;
use OCA\Social\Interfaces\Object\ImageInterface;
use OCA\Social\Interfaces\Object\AnnounceInterface;
@@ -69,6 +70,7 @@ use OCA\Social\Model\ActivityPub\Object\Announce;
use OCA\Social\Model\ActivityPub\Object\Document;
use OCA\Social\Model\ActivityPub\Object\Image;
use OCA\Social\Model\ActivityPub\Object\Note;
+use OCA\Social\Model\ActivityPub\Internal\SocialAppNotification;
use OCA\Social\Model\ActivityPub\Object\Tombstone;
use OCA\Social\Service\ConfigService;
use OCP\AppFramework\QueryException;
@@ -136,6 +138,9 @@ class AP {
/** @var UpdateInterface */
public $updateInterface;
+ /** @var NotificationInterface */
+ public $notificationInterface;
+
/** @var ConfigService */
public $configService;
@@ -167,10 +172,11 @@ class AP {
$ap->followInterface = \OC::$server->query(FollowInterface::class);
$ap->imageInterface = \OC::$server->query(ImageInterface::class);
$ap->likeInterface = \OC::$server->query(LikeInterface::class);
+ $ap->noteInterface = \OC::$server->query(NoteInterface::class);
+ $ap->notificationInterface = \OC::$server->query(SocialAppNotificationInterface::class);
+ $ap->personInterface = \OC::$server->query(PersonInterface::class);
$ap->rejectInterface = \OC::$server->query(RejectInterface::class);
$ap->removeInterface = \OC::$server->query(RemoveInterface::class);
- $ap->personInterface = \OC::$server->query(PersonInterface::class);
- $ap->noteInterface = \OC::$server->query(NoteInterface::class);
$ap->undoInterface = \OC::$server->query(UndoInterface::class);
$ap->updateInterface = \OC::$server->query(UpdateInterface::class);
@@ -178,6 +184,8 @@ class AP {
AP::$activityPub = $ap;
} catch (QueryException $e) {
+ \OC::$server->getLogger()
+ ->logException($e);
}
}
@@ -303,6 +311,9 @@ class AP {
$item = new Note();
break;
+ case SocialAppNotification::TYPE:
+ return new SocialAppNotification();
+
case Person::TYPE:
$item = new Person();
break;
@@ -400,6 +411,10 @@ class AP {
$interface = $this->noteInterface;
break;
+ case SocialAppNotification::TYPE:
+ $service = $this->notificationInterface;
+ break;
+
case Person::TYPE:
$interface = $this->personInterface;
break;