yes, this behaviour is a limitation of editor, related to the way it’s deployed (as an extension).
It’s like that for now because the extension is experimental, but it’s not planned to be like that in the final, production-ready version of the editor.
Having the realtime session joined automatically needs a modification in a piece of code of XWiki that cannot be made by an extension that gets deployed through extension manager. So changing this behaviour would imply making a modification in the product to allow an extension to inject a different behaviour in the lock screen.
If you want to test this you can make a code modification on your XWiki instance, but if you want to keep this change you will then need to maintain this customization on your side. Here’s what you’d need to do:
- have a custom skin in your wiki as described in Skin Application (XWiki.org)
- override the
edit_macros.vm
template as described here Skin Application (XWiki.org)
- copy the content of the original .vm for your instance from the
templates/edit_macros.vm
file of your wiki
- customize this vm as follws:
Just after the line #elseif ($tdoc.getLocked() && !$editForced)
, add the following block of code:
##
## Custom for RT editing: check whether there is a realtime editing open for the current mode and current language (and there is a user in it).
## Confirmation is only needed if there is no realtime session open; when realtime is open, go directly in edit mode to join this session.
##
#set($isRealtimeSessionOpen = false)
## check the current editor, code copied from edit.vm (ideally it should be done in edit.vm before confirmation)
#set($currentEditorForRTDetection = $NULL)
#if ("$!editor" == '')
## Normally no special characters should exist in the editor parameter, so this is just a protection measure.
#set ($currentEditorForRTDetection = "$!{escapetool.xml($request.getParameter('editor'))}")
#if ($currentEditorForRTDetection == '')
#getDefaultDocumentEditor($currentEditorForRTDetection)
#end
#else
#set($currentEditorForRTDetection = $editor)
#end
#if ($currentEditorForRTDetection == 'wysiwyg')
#set($rtSession = $services.netflux.getChannels($tdoc.documentReference, ["$!tdoc.realLocale", 'content', $currentEditorForRTDetection]))
#if ($rtSession.size() > 0 && $rtSession.get(0).userCount > 0)
#set($isRealtimeSessionOpen = true)
#end
#end
#if (!$isRealtimeSessionOpen)
and then close this #if
about 12 lines lower, after the lines
'confirm': $services.localization.render('forcelock')
})
by adding the following line:
#end
Hope this works for you.
I tested it on XWiki 14.10.x on my side, but it should work the same on 15.2.