summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-09 18:06:21 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-09 18:06:21 +0200
commit8e97752bf76aa3b7fb15d734259a9dcd0d82cc73 (patch)
tree42427a9b2b0f2671480774603808c0bfcfa84112
parent926b3c9b7be2c3f0d71a64a60006d373f689da39 (diff)
downloadnextcloud-server-8e97752bf76aa3b7fb15d734259a9dcd0d82cc73.tar.gz
nextcloud-server-8e97752bf76aa3b7fb15d734259a9dcd0d82cc73.zip
adding OC6 public API for activities
-rwxr-xr-xlib/private/activitymanager.php (renamed from lib/activitymanager.php)27
-rw-r--r--lib/public/activity/iconsumer.php15
-rw-r--r--lib/public/activity/imanager.php7
3 files changed, 44 insertions, 5 deletions
diff --git a/lib/activitymanager.php b/lib/private/activitymanager.php
index c1338d873fa..7e7e2257874 100755
--- a/lib/activitymanager.php
+++ b/lib/private/activitymanager.php
@@ -10,24 +10,44 @@ namespace OC;
use OCP\Activity\IConsumer;
+use OCP\Activity\IManager;
-class ActivityManager implements \OCP\Activity\IManager {
+class ActivityManager implements IManager {
private $consumers = array();
/**
* @param $app
* @param $subject
+ * @param $subjectParams
* @param $message
+ * @param $messageParams
* @param $file
* @param $link
+ * @param $affectedUser
+ * @param $type
+ * @param $priority
* @return mixed
*/
- function publishActivity($app, $subject, $message, $file, $link) {
+ function publishActivity($app, $subject, $subjectParams, $message, $messageParams, $file, $link, $affectedUser, $type, $priority) {
foreach($this->consumers as $consumer) {
$c = $consumer();
if ($c instanceof IConsumer) {
- $c->receive($app, $subject, $message, $file, $link);
+ try {
+ $c->receive(
+ $app,
+ $subject,
+ $subjectParams,
+ $message,
+ $messageParams,
+ $file,
+ $link,
+ $affectedUser,
+ $type,
+ $priority);
+ } catch (\Exception $ex) {
+ // TODO: log the excepetion
+ }
}
}
@@ -45,4 +65,5 @@ class ActivityManager implements \OCP\Activity\IManager {
function registerConsumer(\Closure $callable) {
array_push($this->consumers, $callable);
}
+
}
diff --git a/lib/public/activity/iconsumer.php b/lib/public/activity/iconsumer.php
index 4b82bc01b05..ca9bd5096b3 100644
--- a/lib/public/activity/iconsumer.php
+++ b/lib/public/activity/iconsumer.php
@@ -24,6 +24,19 @@
namespace OCP\Activity;
interface IConsumer {
- function receive($app, $subject, $message, $file, $link);
+ /**
+ * @param $app
+ * @param $subject
+ * @param $subjectParams
+ * @param $message
+ * @param $messageParams
+ * @param $file
+ * @param $link
+ * @param $affectedUser
+ * @param $type
+ * @param $priority
+ * @return mixed
+ */
+ function receive($app, $subject, $subjectParams, $message, $messageParams, $file, $link, $affectedUser, $type, $priority );
}
diff --git a/lib/public/activity/imanager.php b/lib/public/activity/imanager.php
index 9cba2db7e7f..99ac2a1958e 100644
--- a/lib/public/activity/imanager.php
+++ b/lib/public/activity/imanager.php
@@ -28,12 +28,17 @@ interface IManager {
/**
* @param $app
* @param $subject
+ * @param $subjectParams
* @param $message
+ * @param $messageParams
* @param $file
* @param $link
+ * @param $affectedUser
+ * @param $type
+ * @param $priority
* @return mixed
*/
- function publishActivity($app, $subject, $message, $file, $link);
+ function publishActivity($app, $subject, $subjectParams, $message, $messageParams, $file, $link, $affectedUser, $type, $priority);
/**
* In order to improve lazy loading a closure can be registered which will be called in case