Skip to content

Commit

Permalink
Merge pull request #147 from nextcloud/bugfix/noid/fix-notifications-…
Browse files Browse the repository at this point in the history
…for-one2one-chats

Fix notifications for one2one chats
  • Loading branch information
nickvergessen authored Aug 2, 2018
2 parents f80a485 + 03dfa99 commit 2feefb2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 1 addition & 2 deletions lib/Push.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ public function pushToDevice(INotification $notification) {

$userKey = $this->keyManager->getKey($user);

$isTalkNotification = \in_array($notification->getApp(), ['spreed', 'talk'], true)
&& \in_array($notification->getSubject(), ['invitation', 'call', 'mention'], true);
$isTalkNotification = \in_array($notification->getApp(), ['spreed', 'talk'], true);
$talkApps = array_filter($devices, function($device) {
return $device['apptype'] === 'talk';
});
Expand Down
5 changes: 0 additions & 5 deletions tests/Unit/PushTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,15 +536,10 @@ public function testPushToDeviceTalkNotification(array $deviceTypes, $isTalkNoti
$notification->expects($this->once())
->method('getApp')
->willReturn('spreed');
$notification->expects($this->once())
->method('getSubject')
->willReturn('call');
} else {
$notification->expects($this->once())
->method('getApp')
->willReturn('notifications');
$notification->expects($this->never())
->method('getSubject');
}

/** @var IUser|\PHPUnit_Framework_MockObject_MockObject $user */
Expand Down

0 comments on commit 2feefb2

Please sign in to comment.