Open shokri-navid opened 1 day ago
So, I apply my changes with this commit:
and now CreateShare request will be directed to the mailShareProvider
Now, I should create an if inside the mail share provider to change its behavior based on the incoming share type (main/ invitation link)
this curl:
curl 'https://nextcloud1.docker/ocs/v2.php/apps/files_sharing/api/v1/shares' --compressed -X POST -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br, zstd' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest, XMLHttpRequest' -H 'requesttoken: CogBvDCUt2iwwH7S4ZjJbhPtB6E3+WOhBKDnXznuN0A=:QN5V9nfV+zH8ghGZksn5OXu9f/J8v1bgRsOkNW6PWzg=' -H 'Origin: https://nextcloud1.docker' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Connection: keep-alive' -H 'Cookie: ocwcmdru45pi=t8ni1ehmdig7hb4sd3jh5v34lj; oc_sessionPassphrase=hh7T1VF2bAqi2PvDBObwoj6SyIsHrWPGuO%2Fa7SVFGcWmjkEBlFmXyyzM0Y5ahSAwMtVFpZ4iLRARZJS1G4Xrt0Rv%2Fm8EUOyqm8s7wLBE%2Byh5OjPlAzlh9z%2FvvIPczEub; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; nc_username=einstein; nc_token=Q8wujbX0LG3s%2BSb9Mr5sgsn4blIdgifZ; nc_session_id=t8ni1ehmdig7hb4sd3jh5v34lj' -H 'Priority: u=0' --data-raw '{"path":"/welcome.txt","permissions":19,"shareType":16,"shareWith":"n@v.com","expireDate":"","attributes":"[{\"value\":true,\"key\":\"download\",\"scope\":\"permissions\"}]"}'
respond like this:
{"ocs":{"meta":{"status":"failure","statuscode":400,"message":"Unknown share type"},"data":[]}}