Skip to content

Commit

Permalink
Fix carddav activities
Browse files Browse the repository at this point in the history
The settings where combined last minute but at the same time the activities
where not adjusted to map an existing setting so the filter was not possible
to even limit it to the types that the activities had.

Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Aug 19, 2022
1 parent 1463f93 commit eab5189
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions apps/dav/lib/CardDAV/Activity/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function triggerAddressbookActivity(string $action, array $addressbook
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
->setObject('addressbook', (int) $addressbookData['id'])
->setType('addressbook')
->setType('contacts')
->setAuthor($currentUser);

$changedVisibleInformation = array_intersect([
Expand Down Expand Up @@ -188,7 +188,7 @@ public function onAddressbookUpdateShares(array $addressbookData, array $shares,
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
->setObject('addressbook', (int) $addressbookData['id'])
->setType('addressbook')
->setType('contacts')
->setAuthor($currentUser);

foreach ($remove as $principal) {
Expand Down Expand Up @@ -433,7 +433,7 @@ public function triggerCardActivity(string $action, array $addressbookData, arra
$event = $this->activityManager->generateEvent();
$event->setApp('dav')
->setObject('addressbook', (int) $addressbookData['id'])
->setType('card')
->setType('contacts')
->setAuthor($currentUser);

$users = $this->getUsersForShares($shares);
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/Activity/Provider/Addressbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct(IFactory $languageFactory,
* @throws \InvalidArgumentException
*/
public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent {
if ($event->getApp() !== 'dav' || $event->getType() !== 'addressbook') {
if ($event->getApp() !== 'dav' || $event->getType() !== 'contacts') {
throw new \InvalidArgumentException();
}

Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/CardDAV/Activity/Provider/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function __construct(IFactory $languageFactory,
* @throws \InvalidArgumentException
*/
public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent {
if ($event->getApp() !== 'dav' || $event->getType() !== 'card') {
if ($event->getApp() !== 'dav' || $event->getType() !== 'contacts') {
throw new \InvalidArgumentException();
}

Expand Down
4 changes: 2 additions & 2 deletions apps/dav/tests/unit/CardDAV/Activity/BackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function testTriggerAddressBookActivity(string $action, array $data, arra
->willReturnSelf();
$event->expects($this->once())
->method('setType')
->with('addressbook')
->with('contacts')
->willReturnSelf();
$event->expects($this->once())
->method('setAuthor')
Expand Down Expand Up @@ -396,7 +396,7 @@ public function testTriggerCardActivity(string $action, array $addressBookData,
->willReturnSelf();
$event->expects($this->once())
->method('setType')
->with('card')
->with('contacts')
->willReturnSelf();
$event->expects($this->once())
->method('setAuthor')
Expand Down

0 comments on commit eab5189

Please sign in to comment.