Merge pull request #3922 from nextcloud/bugfix/3669/fixToOpenPreviewLinksInFilesApp

Bugfix/3669/fix to open preview links in files app
This commit is contained in:
Julius Linus 2024-05-22 08:24:59 -05:00 committed by GitHub
commit f3187187a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -98,7 +98,7 @@ class IncomingLinkPreviewMessageViewHolder(incomingView: View, payload: Any) :
message,
ncApi,
binding.referenceInclude,
context
itemView.context
)
binding.referenceInclude.referenceWrapper.setOnLongClickListener { l: View? ->
commonMessageInterface.onOpenMessageActionsDialog(message)

View File

@ -109,7 +109,7 @@ class OutcomingLinkPreviewMessageViewHolder(outcomingView: View, payload: Any) :
message,
ncApi,
binding.referenceInclude,
context
itemView.context
)
binding.referenceInclude.referenceWrapper.setOnLongClickListener { l: View? ->
commonMessageInterface.onOpenMessageActionsDialog(message)

View File

@ -22,8 +22,8 @@ class UriUtils {
fun isInstanceInternalFileShareUrl(baseUrl: String, url: String): Boolean {
// https://cloud.nextcloud.com/f/41
return url.startsWith("$baseUrl/f/") || url.startsWith("$baseUrl/index.php/f/") &&
Regex(".*/f/d*").matches(url)
return (url.startsWith("$baseUrl/f/") || url.startsWith("$baseUrl/index.php/f/")) &&
Regex(".*/f/\\d*").matches(url)
}
fun extractInstanceInternalFileShareFileId(url: String): String {