diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2015-08-20 15:53:36 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2015-08-20 15:53:36 +0200 |
commit | 9573d7d60d2d2c38ad82c8ca9befeb7ed7fa817f (patch) | |
tree | 53354456a337b3d556a33a9944409e01de8045a2 /apps | |
parent | 337898343c7dee2ca23ebdbb9f0ed7391dc33fb1 (diff) | |
parent | c58316b1ae2657fca041d8ff40499bd4e19ba79a (diff) | |
download | nextcloud-server-9573d7d60d2d2c38ad82c8ca9befeb7ed7fa817f.tar.gz nextcloud-server-9573d7d60d2d2c38ad82c8ca9befeb7ed7fa817f.zip |
Merge pull request #18372 from owncloud/issue-18358-object-type-and-id-for-activities
Issue 18358 object type and id for activities
Diffstat (limited to 'apps')
-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 211dc52c333..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); + $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); + $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(); |