Skip to content
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

Dashboard widget should show the actual mention message #4468

Open
jancborchardt opened this issue Oct 26, 2020 · 5 comments
Open

Dashboard widget should show the actual mention message #4468

jancborchardt opened this issue Oct 26, 2020 · 5 comments
Labels
1. to develop enhancement feature: api 🛠️ OCS API for conversations, chats and participants feature: chat 💬 Chat and system messages good first issue
Milestone

Comments

@jancborchardt
Copy link
Member

Currently, the Dashboard widget only shows "You were mentioned" which is a bit low on info (especially because notifications show more of the message). The subline should show the actual message which mentions you so you can get some more info before clicking.

Conversation list Widget
talk notifications Talk widget
@nickvergessen
Copy link
Member

This is not possible with the current api.
Also what should happen on multiple mentions?

@nickvergessen nickvergessen added this to the 💔 Backlog milestone Oct 27, 2020
@jancborchardt
Copy link
Member Author

This is not possible with the current api.

Yup, that’s what I understood, just opening here so we don’t forget about it. What would need to be changed where to make it work? In Talk I assume, not in Dashboard?

Also what should happen on multiple mentions?

To keep it similar to what happens in the subline of the conversation list: The most recent mention would be shown shown.

@nickvergessen
Copy link
Member

Then we can reuse the stored last mention id, and basically need to adjust the API to optionally load that comment instead of the last message id when getting the rooms. However since we at that point don't know if we will have a match for a mention or call, we wouldn't load the last message for the half empty content message. So I guess we would need to run 2 requests in that case, or we totally bloat up the API response and always return both.

@ChristophWurst
Copy link
Member

As a user I would also prefer if You were mentioned would only be used for direct mentions and not @all.

@nickvergessen nickvergessen added feature: api 🛠️ OCS API for conversations, chats and participants and removed feature: frontend 🖌️ "Web UI" client labels Aug 23, 2023
@nickvergessen
Copy link
Member

With #10250 this turned into a backend task.

The subline is created in

if ($lastMessage instanceof IComment) {
$message = $this->messageParser->createMessage($room, $participant, $room->getLastMessage(), $this->l10n);
$this->messageParser->parseMessage($message);
$now = $this->timeFactory->getDateTime();
$expireDate = $message->getComment()->getExpireDate();
if ((!$expireDate instanceof \DateTime || $expireDate >= $now)
&& $message->getVisibility()) {
$placeholders = $replacements = [];
foreach ($message->getMessageParameters() as $placeholder => $parameter) {
$placeholders[] = '{' . $placeholder . '}';
if ($parameter['type'] === 'user' || $parameter['type'] === 'guest') {
$replacements[] = '@' . $parameter['name'];
} else {
$replacements[] = $parameter['name'];
}
}
$subtitle = str_replace($placeholders, $replacements, $message->getMessage());
}
}
if ($room->getCallFlag() !== Participant::FLAG_DISCONNECTED) {
$subtitle = $this->l10n->t('Call in progress');
} elseif ($participant->getAttendee()->getLastMentionMessage() > $participant->getAttendee()->getLastReadMessage()) {
$subtitle = $this->l10n->t('You were mentioned');
}

As mentioned above we simply can use the "last mentioned id" and start rendering that message instead of the "last message"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop enhancement feature: api 🛠️ OCS API for conversations, chats and participants feature: chat 💬 Chat and system messages good first issue
Projects
None yet
Development

No branches or pull requests

3 participants