Граф коммитов

449 Коммитов

Автор SHA1 Сообщение Дата
Joas Schilling 41a1556957 Correctly check if the share has a password and if it was entered correctly.
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>
2019-09-26 10:54:28 +02:00
Daniel Calviño Sánchez edc54ea5d5 Add support for public shares to file rooms
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>
2019-09-26 10:45:01 +02:00
Joas Schilling 57747a0d7a
Move the "can start call" functionality into a method
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-09-19 15:23:55 +02:00
Joas Schilling d4424477fe
Also prevent starting a call on API level
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-09-19 14:55:59 +02:00
Joas Schilling 5da475f4c0
Populate the canStartCall value and add a capability
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-09-19 14:55:59 +02:00
Joas Schilling bfaff568f3
Merge pull request #2190 from nextcloud/feature/noid/allow-to-mention-the-room-by-name
Allow to mention "all" by autocompleting the room name
2019-09-18 19:10:47 +02:00
Ivan Sein 50e4842a33 Make room display name comparison case-insensitive.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
2019-09-18 17:58:12 +02:00
Joas Schilling 53ecdc1f76
Allow to mention "all" by autocompleting the room name
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-09-15 11:47:04 +02:00
Joas Schilling 88a5c13aa4
Free FilesController
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-09-13 23:09:18 +02:00
Joas Schilling d4fc586f1a
Bye Spreed, hello Talk!
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-09-05 14:29:09 +02:00
Joas Schilling 3eb76168d3
Allow to include the last known message as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-29 14:29:08 +02:00
Joas Schilling 68bb3b7a42
Set the automatic read marker before the waiting request, not afterwards
This false set the read marker on new messages although you
navigated away to a different chat already. So we removed this
and instead update the read marker before your next waiting.
So when you are still there, it will just have a wrong read
marker for the time until your next request starts, while it will
not update the value, when you actually left the chat already.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-28 17:58:22 +02:00
Joas Schilling 6f1e4bef32
Merge pull request #1926 from nextcloud/feature/382/lobby
 Lobby
2019-08-28 15:12:44 +02:00
Joas Schilling b2e30c4708
Merge pull request #2102 from nextcloud/bugfix/2088/support-file-calls-in-groupfolders
Support file calls in groupfolders
2019-08-28 14:19:57 +02:00
Daniel Calviño Sánchez 8745fd19fe Rename lobby constants
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>
2019-08-28 10:28:30 +02:00
Joas Schilling 369c3e44c0 Make the API work with timestamps
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-28 10:28:30 +02:00
Joas Schilling 18336c0b10 Transform time to UTC before storing in the database
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-28 10:28:29 +02:00
Joas Schilling d4b7300828 Remove outdated comment
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-28 10:28:06 +02:00
Joas Schilling 8cd50644d4 Allow a timer as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-28 10:28:06 +02:00
Joas Schilling 36e3da092c No participants and chat messages for users in the lobby
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-28 10:28:05 +02:00
Joas Schilling 7f0dd77951 Allow users to load the room data when joining it
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-28 10:28:05 +02:00
Joas Schilling 6b6f42dde3 Prevent access to some APIs for non-moderators if lobby is enabled
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-28 10:28:05 +02:00
Joas Schilling d8563f8824 Add an API endpoint to set the lobby state
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-28 10:28:05 +02:00
Joas Schilling c9f390de4f
Merge pull request #2121 from nextcloud/get-password-from-session-if-not-given-when-joining-room
Get password from session if not given when joining room
2019-08-28 10:21:16 +02:00
Joas Schilling ee0e77f48f Get password from session if not given when joining room
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-28 09:19:28 +02:00
Ivan Sein 6fa784d3d0
Only update read marker when receiving new messages.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
2019-08-27 11:21:32 +02:00
Joas Schilling fd6cc4a548
Support file calls in groupfolders
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-23 13:33:05 +02:00
Daniel Calviño Sánchez 878962d6af Add user to file room when joining it instead of when getting its token
This fixes the code so it behaves as stated in the documentation.

In practice currently this should make no difference, as in the Files
app the user joins the room immediately after getting its token;
however, this makes possible to get the token without joining the room,
which will be needed in the future to improve the UX of the Files app.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2019-08-16 20:18:30 +02:00
Joas Schilling 3a0503b96f
Expose the message type as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-30 09:36:11 +02:00
Joas Schilling 25aae9f512
Make sure we don't change the comments object as that will update the database
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-30 09:34:47 +02:00
Joas Schilling b14e63db18
Prevent replying to commands and system messages
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-30 09:33:41 +02:00
Joas Schilling a1b17d282f
Allow to reply to messages and return the parent on the message endpoints
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-30 09:33:41 +02:00
Joas Schilling db4826581c
Merge pull request #1214 from nextcloud/feature/noid/unread-message-marker
🆕 Read marker handling based on ID and settable via API
2019-07-25 13:48:44 +02:00
Joas Schilling e935f1978f
Make the read-marker update optional
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-24 15:31:19 +02:00
Joas Schilling 54692ebac3
Change read marker to work on the comment id isntead of datetime
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-24 15:14:00 +02:00
Joas Schilling 8ee67f13c1
Show "Wrong password" info when the conversation password was wrong
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-19 13:16:19 +02:00
Joas Schilling d166ea85a3
Sort mentions with the searched start first
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-08 12:24:39 +02:00
Daniel Calviño Sánchez 2825271bcc
Add document about invisible messages not returned by ChatController
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2019-05-10 14:47:04 +02:00
Joas Schilling 3ac3d42979
Receive post requests with the password too
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-05-06 17:12:21 +02:00
Daniel Calviño Sánchez c145540ab1 Do not allow JavaScript "eval"
Talk no longer uses JavaScript "eval", so the Content Security Policy
can now be configured to prevent its use.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2019-04-10 16:38:08 +02:00
Joas Schilling 1b9f739873
Do not cleanup Changelog rooms
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-04-01 16:00:13 +02:00
Joas Schilling 79246e1d59
Start changelog implementation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-04-01 16:00:13 +02:00
Joas Schilling 695b757754
Allow setting the read-only state of a room
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-25 15:17:20 +01:00
Joas Schilling c739c36c8b
Move CallController to AEnvironmentAwareController and add "@RequireReadWriteConversation"
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-25 15:17:19 +01:00
Joas Schilling f1667ac2f7
Introduce a Read-Only state for conversations
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-25 15:17:19 +01:00
Joas Schilling d2636246c8
Replace duplicate logic with annotation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-15 00:12:06 +01:00
Joas Schilling a4f397a55a
Add "@RequireParticipant" annotation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-14 23:55:42 +01:00
Joas Schilling 37d0f9cc3d
Add "@RequireModeratorParticipant" annotation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-14 23:50:15 +01:00
Joas Schilling c24d63d97e
Add "@RequireLoggedInModeratorParticipant" annotation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-14 23:35:34 +01:00
Joas Schilling c5f2d5971c
Add "@RequireLoggedInParticipant" annotation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-14 23:22:48 +01:00
Joas Schilling 529f7c2f78
Merge pull request #1591 from nextcloud/feature/noid/locked-one-to-one-rooms
Persistent one-to-one rooms
2019-03-14 20:23:06 +01:00
Joas Schilling b572de7fa9
Further fixes for integration tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-14 15:41:36 +01:00
Joas Schilling 44619a1aee
Readd the left-participant to one-to-one rooms if needed
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-14 15:41:35 +01:00
Joas Schilling a96dcaa455
Make one-to-one rooms locked
* No more guests allowed
* You can not add people to it
* You can only leave it, not delete it

Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-14 15:41:33 +01:00
Joas Schilling e8937ffee1
Fix hardcoded `/call/{token}` handling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-14 15:05:43 +01:00
Ivan Sein e16d5f3515 Remove '@ all' mention in one2one rooms.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
2019-03-05 12:02:36 +01:00
Joas Schilling a2fc199811
Use a middleware to prevent access to the APIs too
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-01 11:02:25 +01:00
Joas Schilling b0f7b7ce77
Redirect people to the main app
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-01 08:53:22 +01:00
Joas Schilling 5b759b44c2
Prevent the last moderator from leaving the room
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-03-01 08:39:12 +01:00
Joachim Bauch 6e1e78ec05
Fix removing users when an old session id expires in the signaling server.
It could happen that an old session id expired while a user already re-joined
a room with a new session id. Once the old session id expired, the user got
removed from the room.

Signed-off-by: Joachim Bauch <bauch@struktur.de>
2019-02-28 13:19:51 +01:00
Joas Schilling e3efeb1f70
Merge pull request #1567 from nextcloud/feature/noid/non-empty-room-names
Make  room names non-optional
2019-02-28 08:45:10 +01:00
Joas Schilling 432d930df6
Readd the hack to set the name of one-to-one conversations
because mobile apps and web use it to get the avatar

Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-27 15:26:51 +01:00
Joas Schilling 7e54634fb5
Make room names non-optional
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-27 15:26:50 +01:00
Peter Edens 4ca16cb2e6
Add reason for removing participant from room so that hook can determine if the user was removed by moderator.
Signed-off-by: Peter Edens <petere@conceiva.com>
2019-02-26 10:15:30 +01:00
Joas Schilling 8a17c7f098
Merge pull request #1572 from nextcloud/bugfix/noid/fix-unit-tests-from-1453
Fix unit tests from #1453
2019-02-25 15:05:01 +01:00
Joas Schilling 6edc52c58c
Fix unit tests from #1453
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-21 14:30:20 +01:00
Joas Schilling 58f0bd6d2f
Use call ROS object
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-20 14:44:18 +01:00
Joas Schilling 64ac6950f7
Allow to mention everyone in the conversation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-20 14:44:18 +01:00
Joas Schilling 2f60aab4ab
Introduce a Message model for parsing which also allows to hide messages
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-20 12:17:37 +01:00
Joas Schilling 513062e508
Check enable flag for participant level
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-20 12:17:36 +01:00
Joas Schilling 835e6bdc77
Add console commands to manage commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-20 12:17:35 +01:00
Joas Schilling 18aa82dabf
Do not allow changing/adding scripts via the Web
It's just too dangerous for now.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-20 12:17:35 +01:00
Joas Schilling b6e5120060
Add a service
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-20 12:17:34 +01:00
Joas Schilling d7feb1d31a
Fix actor type and displaying
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-20 12:17:34 +01:00
Joas Schilling 46e51bd63b
Add routes and controller
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-20 12:17:33 +01:00
Joas Schilling c0e34c8729
Start with commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-20 12:17:33 +01:00
Joas Schilling d702aa0841
Use ITimeFactory instead of time()
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-13 16:03:25 +01:00
Joas Schilling 13433b1000
Merge pull request #1534 from nextcloud/fix-slower-active-peers-not-included-in-user-list-returned-by-signaling
Fix slower active users not included in user list returned by signaling
2019-02-13 15:43:23 +01:00
Joas Schilling 2aec53cb49
Use the datetime factory everywhere
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-13 14:27:35 +01:00
Joas Schilling 56460baaf2
Strict controllers and migration
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-13 13:38:55 +01:00
Joas Schilling b742db9f0a
Fix tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-12 16:57:25 +01:00
Daniel Calviño Sánchez 022466ea53 Fix slower active users not included in user list returned by signaling
When a user requests the signaling messages from the internal signaling
server first the last ping of the user is updated. Then, after waiting
for at most 30 seconds, the list of users active in the room is
returned.

That list was based on the users whose last ping happened around 30
seconds ago or less (it could be a bit longer than 30 seconds, but the
described problem remains in that case too); if other user pulled the
messages slightly before the current user and that other user did not
pull the messages again (or the chat messages, as that updates the last
ping too) before the user list was returned that other user was not
included in the list, as her last ping happened more than 30 seconds
ago.

Now the elapsed time since the last ping for users returned in the list
is longer than the timeout used for pulling messages (and chat messages)
to ensure (up to a point) that active users will be included in the list
even if it took a bit longer for them to pull messages again.

The drawback of this approach is that the internal signaling server will
now need a few more seconds to notice when a user left a call abruptly,
but before it was not immediate anyway and it should not be a common
scenario either.

Finally, note that it is unlikely that more than 40 seconds pass between
the ping is updated for the current user and the user list is returned,
but the condition to handle that case gracefully was kept to be on the
safe side.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2019-02-12 13:58:27 +01:00
Ivan Sein 43b1a2f42c
Merge pull request #1522 from nextcloud/fix-current-user-not-included-in-user-list-returned-by-signaling
Fix current user not included in user list returned by signaling
2019-02-08 10:16:50 +01:00
Daniel Calviño Sánchez 3471b9fc39 Fix current user not included in user list returned by signaling
When a user requests the signaling messages from the internal signaling
server first the last ping of the user is updated. Then, after waiting
for at most 30 seconds, the list of users active in the room is
returned.

That list was based on the users whose last ping was more recent than 30
seconds ago, so when there were no other messages and the waiting timed
out the last ping of the current user set when the request started
happened 30 seconds ago or more, and thus the current user was not
included in the returned list (unless her ping was updated to a more
recent value by a different request, like polling for chat messages).

Now the users returned in the list are those whose last ping is more
recent than or equal to 30 seconds, or more recent than or equal to the
signaling ping of the current user if it is larger than 30 seconds.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2019-02-07 17:39:43 +01:00
Joas Schilling fc73085b31
Remove unused constructor argument
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-01-31 15:40:43 +01:00
Joas Schilling 6073445cf6
Remove room information for users which are not a participant
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-01-31 14:44:26 +01:00
Joachim Bauch 3ad0b1bd97
Add hook to allow returning additional data for clients joining a room.
Signed-off-by: Joachim Bauch <bauch@struktur.de>
2018-12-18 15:40:43 +01:00
Daniel Calviño Sánchez abbc59728f
Fix room name when the file is in a shared folder
When the file is in a shared folder and the file is not explicitly
shared the first share found is not for the file, but for the folder. In
that case the file needs to be searched in the shared folder to get the
proper name for the room.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-12-13 16:25:45 +01:00
Daniel Calviño Sánchez 0003d7a864
Extend "has direct access to file" check also to files in shared folders
Before a file was seen as directly accessible by the user if the user
received the file through a user, group, circle or room share. Now files
that are a descendant of a folder that meets those conditions are seen
as directly accessible by the user too.

Due to this now the rooms for files in a shared folder can be accessed
by any user that has access to the folder; it is no longer needed to
explicitly share the file too with them.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-12-13 16:25:45 +01:00
Joas Schilling 1890687981
Also leave the room when the user tries to join and can not access the file anymore
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-12-06 18:05:47 +01:00
Joas Schilling a215f726ac
Explicitly join the room when opening a file sidebar chat
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-12-06 18:05:46 +01:00
Joas Schilling 031d0957f1 Rename included class from "ShareManager" to "IShareManager"
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-12-03 15:50:17 +01:00
Daniel Calviño Sánchez 19e166191b Add end point to get the token of a room associated with a file
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-11-29 18:35:21 +01:00
Joas Schilling 56e90228ab
Also populate the sessionId
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-11-12 11:35:31 +01:00
Joas Schilling 021dc333dc
Use Participant objects were possible
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-11-12 11:35:31 +01:00
Joas Schilling 4afa2d7946
Do not create the participant when we don't need them
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-11-12 11:35:31 +01:00
Mario Danic 3d9fb47a0d
Add session id to participant
This allows for showing if user is online or not in the conversation info list without needing another API call

Signed-off-by: Mario Danic <mario@lovelyhq.com>
2018-11-12 11:35:31 +01:00
Joas Schilling 95cce7d84c
Merge pull request #1273 from nextcloud/add-support-for-sending-the-password-for-a-link-share-by-nextcloud-talk
Add support for sending the password for a link share by Nextcloud Talk
2018-11-12 11:16:11 +01:00
Joas Schilling b7d907700d
Merge pull request #1268 from nextcloud/add-ability-to-invite-groups
Add ability to invite groups
2018-11-09 11:33:14 +01:00
Daniel Calviño Sánchez e13571f8f3 Add support for link shares in "share:password" rooms
Until now only the e-mail shares had support for sending the password by
Talk. In Nextcloud 15 that feature was added to link shares too, so the
room name and the notification sent for "share:password" rooms has to be
adjusted accordingly.

The display name of "share:password" rooms is generated from the raw
name of the room (the e-mail for mail shares and the file name for link
shares) each time the room information is sent by the server, so the
display name was generalized to accomodate both types of raw names.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-11-08 21:00:36 +01:00