File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ class EditorUtils @Inject constructor(private val arbitraryDataProvider: Arbitra
4848 return editors.any { usesOfficeUserAgent(it) && (mimeType in it.mimetypes || mimeType in it.optionalMimetypes) }
4949 }
5050
51+ fun isRichDocumentsDirectEditingAvailable (user : User ? ): Boolean =
52+ getEditors(user)?.any { it.id == RICH_DOCUMENTS_EDITOR_ID } == true
53+
5154 private fun getEditors (user : User ? ): Collection <Editor >? {
5255 val json = arbitraryDataProvider.getValue(user, ArbitraryDataProvider .DIRECT_EDITING )
5356 if (json.isEmpty()) return null
@@ -57,6 +60,7 @@ class EditorUtils @Inject constructor(private val arbitraryDataProvider: Arbitra
5760 fun usesOfficeUserAgent (editor : Editor ? ): Boolean = editor?.id in OFFICE_EDITOR_IDS
5861
5962 companion object {
63+ private const val RICH_DOCUMENTS_EDITOR_ID = " richdocuments"
6064 private val OFFICE_EDITOR_IDS = setOf (" onlyoffice" , " eurooffice" )
6165 }
6266}
Original file line number Diff line number Diff line change @@ -314,7 +314,7 @@ class ChooseTemplateDialogFragment :
314314 path,
315315 creator?.editor,
316316 creator?.id,
317- template.title
317+ template.id
318318 ).execute(nextcloudClient)
319319 if (! result.isSuccess) {
320320 return " "
Original file line number Diff line number Diff line change @@ -273,6 +273,11 @@ class OCFileListBottomSheetDialog(
273273 }
274274
275275 private fun creatorsActionsFromCollabora (): List <CreatorAction > {
276+ // richdocuments 11+ serves its creators through DirectEditing, so the legacy entries would be duplicates.
277+ if (editorUtils.isRichDocumentsDirectEditingAvailable(user)) {
278+ return emptyList()
279+ }
280+
276281 val creatorsActions = ArrayList <CreatorAction >()
277282
278283 fileActivity.capabilities
You can’t perform that action at this time.
0 commit comments