The chat message can be much longer than the maximum length allowed for
notification messages, so the notification message is trimmed if needed.
When the notification is being prepared to be displayed it is taken into
account if the message was trimmed, and in that case an ellipsis is
added at the start and/or the end (depending on the case) of the
message.
Note that the original notification message does not contain the
ellipsis characters, as depending on the language a whitespace should be
added or not before and after an ellipsis, and the language in which the
notification will be displayed is only known at the time of displaying
it, but not when it is saved.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
When a user is mentioned in a chat message she will now receive a
notification about that. If a chat room is deleted all the pending
notifications will be also removed.
The rich subject of the notifications use "call" instead of "room" or
"chat" due to "call" being already available in
"lib/public/RichObjectStrings/Definitions.php" (in Nextcloud server),
although the Notifications app does not handle it in any special way
though ("apps/notifications/js/richObjectStringParser.js").
Note that, unlike with the current code for invitation notifications, no
checks are made on whether "call" is available or not, as the chat is
available only from Nextcloud 13 and onwards.
Currently every user mentioned in a chat message is notified, but this
will be tightened in later commits (for example, if a user is mentioned
in a chat room to which she is not able to join).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>