@@ -81,37 +81,35 @@ public function createShare($params) {
8181
8282 try {
8383 $ externalManager ->addShare ($ remote , $ token , '' , $ name , $ owner , false , $ shareWith , $ remoteId );
84+ $ shareId = \OC ::$ server ->getDatabaseConnection ()->lastInsertId ('*PREFIX*share_external ' );
8485
8586 $ user = $ owner . '@ ' . $ this ->cleanupRemote ($ remote );
8687
8788 \OC ::$ server ->getActivityManager ()->publishActivity (
8889 Activity::FILES_SHARING_APP , Activity::SUBJECT_REMOTE_SHARE_RECEIVED , array ($ user , trim ($ name , '/ ' )), '' , array (),
8990 '' , '' , $ shareWith , Activity::TYPE_REMOTE_SHARE , Activity::PRIORITY_LOW );
9091
91- /**
92- * FIXME
9392 $ urlGenerator = \OC ::$ server ->getURLGenerator ();
9493
9594 $ notificationManager = \OC ::$ server ->getNotificationManager ();
9695 $ notification = $ notificationManager ->createNotification ();
9796 $ notification ->setApp ('files_sharing ' )
9897 ->setUser ($ shareWith )
99- ->setTimestamp(time ())
100- ->setObject('remote_share', $remoteId )
98+ ->setDateTime ( new \ DateTime ())
99+ ->setObject ('remote_share ' , $ shareId )
101100 ->setSubject ('remote_share ' , [$ user , trim ($ name , '/ ' )]);
102101
103102 $ declineAction = $ notification ->createAction ();
104103 $ declineAction ->setLabel ('decline ' )
105- ->setLink($urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/' . $remoteId ), 'DELETE');
104+ ->setLink ($ urlGenerator ->getAbsoluteURL ('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/ ' . $ shareId ), 'DELETE ' );
106105 $ notification ->addAction ($ declineAction );
107106
108107 $ acceptAction = $ notification ->createAction ();
109108 $ acceptAction ->setLabel ('accept ' )
110- ->setLink($urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/' . $remoteId ), 'POST');
109+ ->setLink ($ urlGenerator ->getAbsoluteURL ('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/ ' . $ shareId ), 'POST ' );
111110 $ notification ->addAction ($ acceptAction );
112111
113112 $ notificationManager ->notify ($ notification );
114- */
115113
116114 return new \OC_OCS_Result ();
117115 } catch (\Exception $ e ) {
0 commit comments