-
Notifications
You must be signed in to change notification settings - Fork 508
Add backend for conversation descriptions #4587
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 backend for conversation descriptions #4587
Conversation
|
I don't think the SIP bridge needs the description. If you put a link in there e.g. for a shared presentation, people would get it read out or what?🙈 |
I have no idea, that is why I asked :-P But ok, no description for SIP bridge then ;-) |
b344c27 to
44c59e9
Compare
| $parsedMessage = $this->l->t('An administrator renamed the conversation from "%1$s" to "%2$s"', [$parameters['oldName'], $parameters['newName']]); | ||
| } | ||
| } elseif ($message === 'description_set') { | ||
| $parsedMessage = $this->l->t('{actor} set the description to "%1$s"', [$parameters['newDescription']]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not put the description into the system message.
It can be potentially long and also contain " and then look broken.
Whatsapp and others just write "{actor} updated the description" alike messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we can then use this for create, update and remove at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ma12-co checked other platforms and asked for the description to be shown in the message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be shown, given that:
- It's likely to be very important information for the conversation participants;
- It's s going to be relatively concise since we're capping the max length to 500 chars, so it's not going to be disruptive;
| $properties = array_merge($properties, [ | ||
| 'description' => $this->getDescription(), | ||
| ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not changing anything on the signaling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getPropertiesForSignaling but the data is not used in signaling, so we don't need to expose it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new description will be relayed by the signaling server to the clients in the roomlist->update message. Currently we are not using the updated properties from the message, though, but I think it is better to send it for consistency with the rest of the update messages.
904c9ee to
bd29bf7
Compare
|
Squashed and rebased. It should be ready for a final review :-) The only missing thing would be the How to check that the database supports multibyte strings to use |
mb is always better to use, as it prevents cutting inside a utf8 char |
I will rebase it, happened with #4702 |
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Only moderators and guest moderators of group and public conversations can set their description. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
As the description is not typically needed in the conversation list, it
could be potentially "large" and the conversation list is fetched
frequently only a hash of the description is returned in that case. The
exception is when the description is empty, in which case an empty value
is returned, instead of the value of "sha1('')".
If only a single conversation is fetched the actual description is
always returned.
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
As the description length is limited and the response for the conversation list endpoint is gzip compressed the hash does not provide too much of a reduction, but introduces a more complex logic in the clients. Due to all this, for simplicity now the raw description is also returned when getting the conversation list. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
bd29bf7 to
4667b1a
Compare
|
Simply dropped "Guard against using undefined 'participants' key" which did exactly the same as 6206ca7 just a few lines further up |
Requires #4656
Probably should be merged after #4496 (there will be conflicts, but it should be easier to fix them here)
Fixes (the backend part of) #3432
Only moderators and guest moderators of group and public conversations can set their description.
Setting and getting the description is available only in version 3 of the API.
The description is returned along the rest of the information of a conversation.
However, as the description is not typically needed in the conversation list, it could be potentially "large" and the conversation list is fetched frequently only a hash of the description is returned in that case. The exception is when the description is empty, in which case an empty value is returned, instead of the value ofsha1('').If only a single conversation is fetched the actual description is always returned.Due to design reasons the description is now limited to just 250 characters. Moreover, the OCS endpoint is gzip compressed, so sending the raw description instead of the hash when fetching the conversation list does not reduce the size too much, but introduces an inconsistency between the data of a single conversation and all conversations, which requires a more complex logic in the clients (and specifically in the WebUI it would require quite some changes). Due to all this, for simplicity the raw description is also returned when getting the conversation list.Also for simplicity the owner of a password request conversation can currently set the description, even if there is probably no point on doing that. Preventing it would be easy, though, just something similar to 630e2f4
When the description is changed the external signaling server is notified and the new description is sent; the description, like the other properties, is sent whenever the conversation is modified, even if the description itself was not modified, but (if I recall correctly) this is needed for the external signaling server to track the changes.
Pending:
strleninstead ofmb_strlenif it does not? Or remove the guard from the controller and just handle if there is an error when setting the description in the database? Or do both (for example, always guard withmb_strlen, but also handle the error)?