Skip to content

feat: Open file links from chat messages in the Nextcloud Files app - #2812

Open
Ivansss wants to merge 1 commit into
mainfrom
feat/noid/open-file-links-in-files-app
Open

Ivansss wants to merge 1 commit into
mainfrom
feat/noid/open-file-links-in-files-app

Conversation

@Ivansss

@Ivansss Ivansss commented Nov 6, 2026

Copy link
Copy Markdown
Member

Tapping a link to a file or folder on the user's server now opens it in the Nextcloud Files app when it's installed, the same way links to rooms open in Talk. Without the Files app, links keep opening in the browser.

Recognised links (with or without /index.php)

  • {server}/f/{id}
  • {server}/apps/files/files/{id}?dir=…
  • {server}/apps/files/?dir=…&fileid={id}

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
@Ivansss
Ivansss requested a review from SystemKeeper November 6, 2026 15:23
Comment on lines +173 to +177
public static func instanceFileId(fromLink link: String) -> String? {
let activeAccount = NCDatabaseManager.sharedInstance().activeAccount()

return self.instanceFileId(fromLink: link, serverUrl: activeAccount.server)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we try to remove/reduce the usage of activeAccount, I wonder if we should remove that helper method and rely on the one below

public static func openFileInNextcloudApp(fileId: String) {
let activeAccount = NCDatabaseManager.sharedInstance().activeAccount()

// Since https://github.com/nextcloud/ios/pull/3983 the Files app ignores the path and looks the file up by the id at the end of the link

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we then go ahead and change the method to remove the path completely? I don't see a point of keeping it then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants