-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for sending the password for a link share by Nextcloud Talk #1273
Add support for sending the password for a link share by Nextcloud Talk #1273
Conversation
bc3443f
to
0a8dce9
Compare
@nickvergessen Could you take over this to fix the pending issues? Thanks :-) |
I think it is good as is now |
Mmm, when the file is added to the notification clicking on the notification to go to the call is no longer possible using the Notification app in the WebUI. This happens because the file template generates a link to the file, and the link for the full subject is used only when the subject has no links. In this case the link to the call is much more relevant than the link to the file, so... I am not sure what to do with that :-) Do as you wish ;-) Regarding the room name I would prefer to keep the "namespaced" object types. I guess that they were changed to be able to use one text or the other in the However, I would rather keep the object type as Another even simpler approach would be to use a generic text like Password request: XXX where XXX is the e-mail or the file name, instead of Password request by {email} and Password request for {file}; it would not have the more descriptive name with both the e-mail and file name, but after all there is not much space in the room list for long names, and this would make possible to keep the current Besides all that, I have noticed that the file target of a share is not updated when the file name changes (I do not know if that is the expected behaviour or a bug in the server), so if the sharer renames the file after enabling the password request by Talk the room name will show the old file name (due to being based on the file target of the share); notifications are fine, as they get the file object everytime they are generated. Also, the room name shown in the sidebar is the raw room name, that is, just the e-mail address or just the file name, without the formatting to add the Password request part. This is caused by using the |
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
481a9e6
to
0dbf1e0
Compare
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
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>
Signed-off-by: Joas Schilling <coding@schilljs.com>
0dbf1e0
to
ad22021
Compare
I have squashed the room name fix into the original commit to add support for link shares, and I have added another commit to remove an unused attribute from @nickvergessen No notification is sent when using an undefined type for the rich object parameter (last commit); the problem seems to be that when getting an undefined type an exception is thrown, so the validation of the parameter fails, and with this the validation of the notification, and thus the notification ends being ignored. |
Signed-off-by: Joas Schilling <coding@schilljs.com>
ad22021
to
876165b
Compare
Tested and works 👍 |
Requires #1267
Required by nextcloud/server#11875
Regarding Talk the differences between protecting the password of an e-mail share or a link share are minimal; despite that, this pull request is required by the server changes. The reason is that link shares do not have a value in their
sharedWith
field (when got with the OCS enpoint they do, although it is set by theShareAPIController
, internally they have none), so without those changes when the room for the link share was created the name of the room was set tonull
. When the call activity is generated the room name is expected to be a string, but as the name wasnull
PHP complained, no proper HTTP response was sent and the UI broke.TODO:The room name should be fixed. Currently it is set to the e-mail address or the target of the share (depending on the type of share), and in the
RoomController
it is composed and returned as Password request by {roomName}.This was done to show the room name in the language of the sharer, but now that the name needs to be different depending on the share type it would require to get the share object to check its type every time a room is formatted.
It would be better to set the name once (and update it when needed, for example if the file name of a link share changes) than adding those extra queries, for example, every time that the list of rooms is got.
The notification sent for a link share should probably include the name of the file in its message; Someone requested the password to access a share is too vague.