Skip to content

Commit 14cafa4

Browse files
SystemKeeperbackportbot[bot]
authored andcommitted
fix: Unused parameter for encryptAndSign
fix: Unused parameter for encryptAndSign Signed-off-by: Marcel Müller <marcel-mueller@gmx.de> [skip ci]
1 parent 4dbf0d5 commit 14cafa4

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

lib/Push.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ public function proxyPushToDevice(int $id, IUser $user, array $devices, INotific
447447

448448
$this->printInfo('');
449449
$this->printInfo('Found ' . count($devices) . ' devices registered for push notifications');
450-
$isTalkNotification = \in_array($notification->getApp(), ['spreed', 'talk', 'admin_notification_talk'], true);
450+
451451
$devices = $this->filterProxyDeviceList($devices, $notification->getApp());
452452
if (empty($devices)) {
453453
$this->printInfo('<comment>No devices left after filtering</comment>');
@@ -461,7 +461,7 @@ public function proxyPushToDevice(int $id, IUser $user, array $devices, INotific
461461
$this->printInfo('Device token: ' . $device['token']);
462462

463463
try {
464-
$payload = json_encode($this->encryptAndSign($userKey->getPrivate(), $device, $id, $notification, $isTalkNotification), JSON_THROW_ON_ERROR);
464+
$payload = json_encode($this->encryptAndSign($userKey->getPrivate(), $device, $id, $notification), JSON_THROW_ON_ERROR);
465465

466466
$proxyServer = rtrim($device['proxyserver'], '/');
467467
if (!isset($this->payloadsToSend[$proxyServer])) {
@@ -952,13 +952,12 @@ protected function getNotifTopicAndUrgency(string $app, string $type): array {
952952
* @param array $device
953953
* @param int $id
954954
* @param INotification $notification
955-
* @param bool $isTalkNotification
956955
* @return array
957956
* @psalm-return array{deviceIdentifier: string, pushTokenHash: string, subject: string, signature: string, priority: string, type: string}
958957
* @throws InvalidTokenException
959958
* @throws \InvalidArgumentException
960959
*/
961-
protected function encryptAndSign(string $userPrivateKey, array $device, int $id, INotification $notification, bool $isTalkNotification): array {
960+
protected function encryptAndSign(string $userPrivateKey, array $device, int $id, INotification $notification): array {
962961
$data = $this->encodeNotif($id, $notification, 200);
963962
$ret = $this->getNotifTopicAndUrgency($data['app'], $data['type']);
964963
$priority = $ret['urgency'];

tests/Unit/PushTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ public function testProxyPushToDeviceTalkNotification(array $deviceTypes, bool $
826826

827827
$push->expects($this->exactly(1))
828828
->method('encryptAndSign')
829-
->with($this->anything(), $devices[$pushedDevice], $this->anything(), $this->anything(), $isTalkNotification)
829+
->with($this->anything(), $devices[$pushedDevice], $this->anything(), $this->anything())
830830
->willReturn(['Payload']);
831831

832832
/** @var IClient&MockObject $client */

0 commit comments

Comments
 (0)