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

Notify about DND status when trying to resend call notification #11282

Closed
nickvergessen opened this issue Dec 20, 2023 · 2 comments · Fixed by #12283
Closed

Notify about DND status when trying to resend call notification #11282

nickvergessen opened this issue Dec 20, 2023 · 2 comments · Fixed by #12283
Assignees
Labels
1. to develop bug feature: api 🛠️ OCS API for conversations, chats and participants feature: call 📹 Voice and video calls feature: frontend 🖌️ "Web UI" client good first issue
Milestone

Comments

@nickvergessen
Copy link
Member

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Have a user that is on DND
  2. Send them the call notification again

Expected behaviour

Either it works or I know it didn't

Actual behaviour

Moderator is not notified that no push notification was send.

@nickvergessen
Copy link
Member Author

nickvergessen commented May 2, 2024

🛠️ API work

Basically

public function sendCallNotificationForAttendee(Room $room, Participant $currentParticipant, int $targetAttendeeId): void {
$attendee = $this->attendeeMapper->getById($targetAttendeeId);
if ($attendee->getActorType() !== Attendee::ACTOR_USERS) {
throw new \InvalidArgumentException('actor-type');
}
if ($attendee->getRoomId() !== $room->getId()) {
throw new DoesNotExistException('Room mismatch');
}
$sessions = $this->sessionMapper->findByAttendeeId($targetAttendeeId);
foreach ($sessions as $session) {
if ($session->getInCall() !== Participant::FLAG_DISCONNECTED) {
return;
}
}
$target = new Participant($room, $attendee, null);
$event = new CallNotificationSendEvent($room, $currentParticipant, $target);
$this->dispatcher->dispatchTyped($event);
}

should get the user status via
https://github.com/nextcloud/server/blob/f19645adab404a9c2642b42ec335bf2830dd8aa7/lib/public/UserStatus/IManager.php#L45
check if it's DND. If it is, throw an exception (InvalidArgumentException with code/message is good enough atm) and the controller should return an return new DataResponse(['error' => 'status'], Http::STATUS_BAD_REQUEST);

🖌️ Follow up for Frontenders

Afterwards clients/frontend should handle this error message with a dedicated user shown message

@skalidindi53
Copy link
Contributor

skalidindi53 commented May 5, 2024

This issue looks interesting, I will start working now! :) @nickvergessen Could I also be assigned this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop bug feature: api 🛠️ OCS API for conversations, chats and participants feature: call 📹 Voice and video calls feature: frontend 🖌️ "Web UI" client good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants