зеркало из https://github.com/nextcloud/spreed.git
Use the token instead of the id to identify the room objects
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
a05afab2ad
Коммит
0c338c914c
|
@ -68,7 +68,7 @@ class Hooks {
|
|||
try {
|
||||
$notification->setApp('spreed')
|
||||
->setDateTime($dateTime)
|
||||
->setObject('room', $room->getId())
|
||||
->setObject('room', $room->getToken())
|
||||
->setSubject('invitation', [
|
||||
'actorId' => $actor->getUID(),
|
||||
]);
|
||||
|
@ -111,7 +111,7 @@ class Hooks {
|
|||
try {
|
||||
// Remove all old notifications for this room
|
||||
$notification->setApp('spreed')
|
||||
->setObject('room', $room->getId());
|
||||
->setObject('room', $room->getToken());
|
||||
$this->notificationManager->markProcessed($notification);
|
||||
|
||||
$notification->setObject('call', $room->getId());
|
||||
|
|
|
@ -33,7 +33,6 @@ use OCP\L10N\IFactory;
|
|||
use OCP\Notification\INotification;
|
||||
use OCP\Notification\INotifier;
|
||||
use OCP\RichObjectStrings\Definitions;
|
||||
use OCP\RichObjectStrings\InvalidObjectExeption;
|
||||
|
||||
class Notifier implements INotifier {
|
||||
|
||||
|
@ -82,10 +81,15 @@ class Notifier implements INotifier {
|
|||
$l = $this->lFactory->get('spreed', $languageCode);
|
||||
|
||||
try {
|
||||
$room = $this->manager->getRoomById((int) $notification->getObjectId());
|
||||
$room = $this->manager->getRoomByToken((int) $notification->getObjectId());
|
||||
} catch (RoomNotFoundException $e) {
|
||||
// Room does not exist
|
||||
throw new \InvalidArgumentException('Invalid room');
|
||||
try {
|
||||
// Before 3.2.3 the id was passed in notifications
|
||||
$room = $this->manager->getRoomById((int) $notification->getObjectId());
|
||||
} catch (RoomNotFoundException $e) {
|
||||
// Room does not exist
|
||||
throw new \InvalidArgumentException('Invalid room');
|
||||
}
|
||||
}
|
||||
|
||||
$notification
|
||||
|
|
Загрузка…
Ссылка в новой задаче