Skip to content

Commit

Permalink
Merge pull request #3922 from nextcloud/bugfix/3669/fixToOpenPreviewL…
Browse files Browse the repository at this point in the history
…inksInFilesApp

Bugfix/3669/fix to open preview links in files app
  • Loading branch information
rapterjet2004 authored May 22, 2024
2 parents fd9f0fd + c7a7206 commit f318718
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/nextcloud/talk/utils/UriUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f318718

Please sign in to comment.