diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-08-19 17:37:55 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-08-19 17:44:57 +0200 |
commit | 4314c8fc6f5560323e3c811cf2ce40f22d718211 (patch) | |
tree | 90130f145ffa4a1caa4c68953b32a0736ba821bf /apps/files_sharing/api/server2server.php | |
parent | e985dcc5a079c5b51956e7f42c5c36e310b03679 (diff) | |
download | nextcloud-server-4314c8fc6f5560323e3c811cf2ce40f22d718211.tar.gz nextcloud-server-4314c8fc6f5560323e3c811cf2ce40f22d718211.zip |
Use an IEvent object instead of a huge parameter list
Diffstat (limited to 'apps/files_sharing/api/server2server.php')
-rw-r--r-- | apps/files_sharing/api/server2server.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php index 0a35401904b..4328e3830ba 100644 --- a/apps/files_sharing/api/server2server.php +++ b/apps/files_sharing/api/server2server.php @@ -111,9 +111,14 @@ class Server2Server { if ($share) { list($file, $link) = self::getFile($share['uid_owner'], $share['file_source']); - \OC::$server->getActivityManager()->publishActivity( - Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_ACCEPTED, array($share['share_with'], basename($file)), '', array(), - $file, $link, $share['uid_owner'], Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_LOW, 'files', $share['file_source']); + $event = \OC::$server->getActivityManager()->generateEvent(); + $event->setApp(Activity::FILES_SHARING_APP) + ->setType(Activity::TYPE_REMOTE_SHARE) + ->setAffectedUser($share['uid_owner']) + ->setSubject(Activity::SUBJECT_REMOTE_SHARE_ACCEPTED, [$share['share_with'], basename($file)]) + ->setObject('files', $share['file_source'], $file) + ->setLink($link); + \OC::$server->getActivityManager()->publish($event); } return new \OC_OCS_Result(); @@ -142,9 +147,14 @@ class Server2Server { list($file, $link) = $this->getFile($share['uid_owner'], $share['file_source']); - \OC::$server->getActivityManager()->publishActivity( - Activity::FILES_SHARING_APP, Activity::SUBJECT_REMOTE_SHARE_DECLINED, array($share['share_with'], basename($file)), '', array(), - $file, $link, $share['uid_owner'], Activity::TYPE_REMOTE_SHARE, Activity::PRIORITY_LOW, 'files', $share['file_source']); + $event = \OC::$server->getActivityManager()->generateEvent(); + $event->setApp(Activity::FILES_SHARING_APP) + ->setType(Activity::TYPE_REMOTE_SHARE) + ->setAffectedUser($share['uid_owner']) + ->setSubject(Activity::SUBJECT_REMOTE_SHARE_DECLINED, [$share['share_with'], basename($file)]) + ->setObject('files', $share['file_source'], $file) + ->setLink($link); + \OC::$server->getActivityManager()->publish($event); } return new \OC_OCS_Result(); |