This prevents joining the room for a file shared by link and protected
by password if the password has not been entered yet.
Signed-off-by: Joas Schilling <coding@schilljs.com>
The "I see that the current page is the shared link I wrote down" step
is defined in the server but needs to be extended in Talk to also set
(in the tests) the Talk sidebar as the ancestor of the chat view.
In order to extend a step the whole Context that it belongs to must be
extended. Note, however, that the step in the child Context should not
include any "Given", "When" or "Then" annotation, as it would clash with
the step defined in the parent Context (the "Override" annotation is
simply informative, as it is ignored by Behat); as long as the method
has the same signature the step from the child Context will be used
instead if the step from the parent Context.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Self-joined users and guests can join the room for a file if the file is
shared by link. In order to check that, however, the share token should
have been previously stored in the session, as the room is linked to the
file id and users without direct access to a file can not find out if
the file is shared by link or not. Therefore self-joined users and
guests must get the room for the share (which stores the share token in
the session) before being able to join the room.
Besides that, in the case of self-joined users they must be logged in
too. Otherwise the session is regenerated on each new request, which
prevents getting the share token stored in a previous request.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Until now file rooms were available only to users with direct access to
the file. Now file rooms are available to any user or guest too if the
link is publicly shared (with a link share, for example).
Public shares are identified by a share token instead of a file id, so a
new endpoint, which is a counterpart of FilesController but for share
tokens, was added. The file room, however, is still associated to the
file id like before.
When checking if a participant can join a room if the current user is a
user without direct access to the file or a guest it is not even
possible to know if the file id belongs to a publicly shared file. Due
to this when the room is got for a share token the share token is stored
in the session and then used in following requests when checking whether
the participant can join a room or not.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The lobby constants were named from the point of view of the webinary
(open to all participants, open to moderators only), but from the point
of view of the lobby it is the opposite (no lobby, lobby for non
moderators).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>