Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: "Share from Nextcloud" support #540

Merged
merged 5 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

- Currently not supported:
- Screen sharing ([#11](https://github.com/nextcloud/talk-desktop/issues/11))
- Share from Nextcloud (including files creation) ([#12](https://github.com/nextcloud/talk-desktop/issues/12))
- Contacts menu on user avatars menus ([#34](https://github.com/nextcloud/talk-desktop/issues/34))
- Setting User Status ([#26](https://github.com/nextcloud/talk-desktop/issues/26))
- Search ([#30](https://github.com/nextcloud/talk-desktop/issues/30))
Expand Down
5 changes: 3 additions & 2 deletions src/app/webRequestInterceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function enableWebRequestInterceptor(serverUrl, {
}

const ALLOWED_ORIGIN = [process.env.NODE_ENV === 'production' ? 'file://' : `${DEV_SERVER_ORIGIN}`]
const ALLOWED_METHODS = ['GET, POST, PUT, PATCH, DELETE, PROPFIND, MKCOL'] // Includes WebDAV
const ALLOWED_METHODS = ['GET, POST, PUT, PATCH, DELETE, PROPFIND, MKCOL, SEARCH, REPORT'] // Includes WebDAV
const ALLOWED_CREDENTIALS_TRUE = ['true']
const ALLOWED_HEADERS = [[
// Common
Expand All @@ -90,10 +90,11 @@ function enableWebRequestInterceptor(serverUrl, {
'If-None-Match',
// WebDAV
'Depth',
'requesttoken',
// Nextcloud
'requesttoken',
'OCS-APIRequest',
'X-OC-MTIME',
'X-Requested-With',
].join(', ')]
const EXPOSED_HEADERS = [[
// Common headers
Expand Down
1 change: 0 additions & 1 deletion src/patchers/@nextcloud/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import axios from '@desktop-modules--@nextcloud/axios'

axios.interceptors.request.use((config) => {
config.withCredentials = true
delete config.headers.requesttoken
config.headers['OCS-APIRequest'] = 'true'
return config
}, (error) => Promise.reject(error))
Expand Down
4 changes: 2 additions & 2 deletions src/patchers/@nextcloud/initial-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ function getInitialStateFromCapabilities(capabilities, userMetadata) {
// eslint-disable-next-line jsdoc/require-jsdoc
export function loadState(app, key, fallback) {
const capabilities = getInitialStateFromCapabilities(appData.capabilities, appData.userMetadata)
const elem = capabilities[app][key]
if (elem === null) {
const elem = capabilities[app]?.[key]
if (elem === null || elem === undefined) {
if (fallback !== undefined) {
return fallback
}
Expand Down
Loading