@@ -32,39 +32,39 @@ |
||
32 | 32 | */ |
33 | 33 | interface IBackend { |
34 | 34 | |
35 | - /** |
|
36 | - * get a list of all resources in this backend |
|
37 | - * |
|
38 | - * @throws BackendTemporarilyUnavailableException |
|
39 | - * @return IResource[] |
|
40 | - * @since 14.0.0 |
|
41 | - */ |
|
42 | - public function getAllResources():array; |
|
35 | + /** |
|
36 | + * get a list of all resources in this backend |
|
37 | + * |
|
38 | + * @throws BackendTemporarilyUnavailableException |
|
39 | + * @return IResource[] |
|
40 | + * @since 14.0.0 |
|
41 | + */ |
|
42 | + public function getAllResources():array; |
|
43 | 43 | |
44 | - /** |
|
45 | - * get a list of all resource identifiers in this backend |
|
46 | - * |
|
47 | - * @throws BackendTemporarilyUnavailableException |
|
48 | - * @return string[] |
|
49 | - * @since 14.0.0 |
|
50 | - */ |
|
51 | - public function listAllResources():array; |
|
44 | + /** |
|
45 | + * get a list of all resource identifiers in this backend |
|
46 | + * |
|
47 | + * @throws BackendTemporarilyUnavailableException |
|
48 | + * @return string[] |
|
49 | + * @since 14.0.0 |
|
50 | + */ |
|
51 | + public function listAllResources():array; |
|
52 | 52 | |
53 | - /** |
|
54 | - * get a resource by it's id |
|
55 | - * |
|
56 | - * @param string $id |
|
57 | - * @throws BackendTemporarilyUnavailableException |
|
58 | - * @return IResource|null |
|
59 | - * @since 14.0.0 |
|
60 | - */ |
|
61 | - public function getResource($id); |
|
53 | + /** |
|
54 | + * get a resource by it's id |
|
55 | + * |
|
56 | + * @param string $id |
|
57 | + * @throws BackendTemporarilyUnavailableException |
|
58 | + * @return IResource|null |
|
59 | + * @since 14.0.0 |
|
60 | + */ |
|
61 | + public function getResource($id); |
|
62 | 62 | |
63 | - /** |
|
64 | - * Get unique identifier of the backend |
|
65 | - * |
|
66 | - * @return string |
|
67 | - * @since 14.0.0 |
|
68 | - */ |
|
69 | - public function getBackendIdentifier():string; |
|
63 | + /** |
|
64 | + * Get unique identifier of the backend |
|
65 | + * |
|
66 | + * @return string |
|
67 | + * @since 14.0.0 |
|
68 | + */ |
|
69 | + public function getBackendIdentifier():string; |
|
70 | 70 | } |
@@ -31,41 +31,41 @@ |
||
31 | 31 | */ |
32 | 32 | interface IManager { |
33 | 33 | |
34 | - /** |
|
35 | - * Registers a room backend |
|
36 | - * |
|
37 | - * @param IBackend $backend |
|
38 | - * @return void |
|
39 | - * @since 14.0.0 |
|
40 | - */ |
|
41 | - public function registerBackend(IBackend $backend); |
|
34 | + /** |
|
35 | + * Registers a room backend |
|
36 | + * |
|
37 | + * @param IBackend $backend |
|
38 | + * @return void |
|
39 | + * @since 14.0.0 |
|
40 | + */ |
|
41 | + public function registerBackend(IBackend $backend); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Unregisters a room backend |
|
45 | - * |
|
46 | - * @param IBackend $backend |
|
47 | - * @return void |
|
48 | - * @since 14.0.0 |
|
49 | - */ |
|
50 | - public function unregisterBackend(IBackend $backend); |
|
43 | + /** |
|
44 | + * Unregisters a room backend |
|
45 | + * |
|
46 | + * @param IBackend $backend |
|
47 | + * @return void |
|
48 | + * @since 14.0.0 |
|
49 | + */ |
|
50 | + public function unregisterBackend(IBackend $backend); |
|
51 | 51 | |
52 | - /** |
|
53 | - * @return IBackend[] |
|
54 | - * @since 14.0.0 |
|
55 | - */ |
|
56 | - public function getBackends():array; |
|
52 | + /** |
|
53 | + * @return IBackend[] |
|
54 | + * @since 14.0.0 |
|
55 | + */ |
|
56 | + public function getBackends():array; |
|
57 | 57 | |
58 | - /** |
|
59 | - * @param string $backendId |
|
60 | - * @return IBackend |
|
61 | - * @since 14.0.0 |
|
62 | - */ |
|
63 | - public function getBackend($backendId):IBackend; |
|
58 | + /** |
|
59 | + * @param string $backendId |
|
60 | + * @return IBackend |
|
61 | + * @since 14.0.0 |
|
62 | + */ |
|
63 | + public function getBackend($backendId):IBackend; |
|
64 | 64 | |
65 | - /** |
|
66 | - * removes all registered backend instances |
|
67 | - * @return void |
|
68 | - * @since 14.0.0 |
|
69 | - */ |
|
70 | - public function clear(); |
|
65 | + /** |
|
66 | + * removes all registered backend instances |
|
67 | + * @return void |
|
68 | + * @since 14.0.0 |
|
69 | + */ |
|
70 | + public function clear(); |
|
71 | 71 | } |
@@ -32,39 +32,39 @@ |
||
32 | 32 | */ |
33 | 33 | interface IBackend { |
34 | 34 | |
35 | - /** |
|
36 | - * get a list of all rooms in this backend |
|
37 | - * |
|
38 | - * @throws BackendTemporarilyUnavailableException |
|
39 | - * @return IRoom[] |
|
40 | - * @since 14.0.0 |
|
41 | - */ |
|
42 | - public function getAllRooms():array; |
|
35 | + /** |
|
36 | + * get a list of all rooms in this backend |
|
37 | + * |
|
38 | + * @throws BackendTemporarilyUnavailableException |
|
39 | + * @return IRoom[] |
|
40 | + * @since 14.0.0 |
|
41 | + */ |
|
42 | + public function getAllRooms():array; |
|
43 | 43 | |
44 | - /** |
|
45 | - * get a list of all room identifiers in this backend |
|
46 | - * |
|
47 | - * @throws BackendTemporarilyUnavailableException |
|
48 | - * @return string[] |
|
49 | - * @since 14.0.0 |
|
50 | - */ |
|
51 | - public function listAllRooms():array; |
|
44 | + /** |
|
45 | + * get a list of all room identifiers in this backend |
|
46 | + * |
|
47 | + * @throws BackendTemporarilyUnavailableException |
|
48 | + * @return string[] |
|
49 | + * @since 14.0.0 |
|
50 | + */ |
|
51 | + public function listAllRooms():array; |
|
52 | 52 | |
53 | - /** |
|
54 | - * get a room by it's id |
|
55 | - * |
|
56 | - * @param string $id |
|
57 | - * @throws BackendTemporarilyUnavailableException |
|
58 | - * @return IRoom|null |
|
59 | - * @since 14.0.0 |
|
60 | - */ |
|
61 | - public function getRoom($id); |
|
53 | + /** |
|
54 | + * get a room by it's id |
|
55 | + * |
|
56 | + * @param string $id |
|
57 | + * @throws BackendTemporarilyUnavailableException |
|
58 | + * @return IRoom|null |
|
59 | + * @since 14.0.0 |
|
60 | + */ |
|
61 | + public function getRoom($id); |
|
62 | 62 | |
63 | - /** |
|
64 | - * Get unique identifier of the backend |
|
65 | - * |
|
66 | - * @return string |
|
67 | - * @since 14.0.0 |
|
68 | - */ |
|
69 | - public function getBackendIdentifier():string; |
|
63 | + /** |
|
64 | + * Get unique identifier of the backend |
|
65 | + * |
|
66 | + * @return string |
|
67 | + * @since 14.0.0 |
|
68 | + */ |
|
69 | + public function getBackendIdentifier():string; |
|
70 | 70 | } |
@@ -31,31 +31,31 @@ discard block |
||
31 | 31 | $app->registerHooks(); |
32 | 32 | |
33 | 33 | \OC::$server->registerService('CardDAVSyncService', function() use ($app) { |
34 | - return $app->getSyncService(); |
|
34 | + return $app->getSyncService(); |
|
35 | 35 | }); |
36 | 36 | |
37 | 37 | $eventDispatcher = \OC::$server->getEventDispatcher(); |
38 | 38 | |
39 | 39 | $eventDispatcher->addListener('OCP\Federation\TrustedServerEvent::remove', |
40 | - function(GenericEvent $event) use ($app) { |
|
41 | - /** @var CardDavBackend $cardDavBackend */ |
|
42 | - $cardDavBackend = $app->getContainer()->query(CardDavBackend::class); |
|
43 | - $addressBookUri = $event->getSubject(); |
|
44 | - $addressBook = $cardDavBackend->getAddressBooksByUri('principals/system/system', $addressBookUri); |
|
45 | - if (!is_null($addressBook)) { |
|
46 | - $cardDavBackend->deleteAddressBook($addressBook['id']); |
|
47 | - } |
|
48 | - } |
|
40 | + function(GenericEvent $event) use ($app) { |
|
41 | + /** @var CardDavBackend $cardDavBackend */ |
|
42 | + $cardDavBackend = $app->getContainer()->query(CardDavBackend::class); |
|
43 | + $addressBookUri = $event->getSubject(); |
|
44 | + $addressBook = $cardDavBackend->getAddressBooksByUri('principals/system/system', $addressBookUri); |
|
45 | + if (!is_null($addressBook)) { |
|
46 | + $cardDavBackend->deleteAddressBook($addressBook['id']); |
|
47 | + } |
|
48 | + } |
|
49 | 49 | ); |
50 | 50 | |
51 | 51 | $eventHandler = function() use ($app) { |
52 | - try { |
|
53 | - $job = $app->getContainer()->query(\OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob::class); |
|
54 | - $job->run(); |
|
55 | - $app->getContainer()->getServer()->getJobList()->setLastRun($job); |
|
56 | - } catch(\Exception $ex) { |
|
57 | - $app->getContainer()->getServer()->getLogger()->logException($ex); |
|
58 | - } |
|
52 | + try { |
|
53 | + $job = $app->getContainer()->query(\OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob::class); |
|
54 | + $job->run(); |
|
55 | + $app->getContainer()->getServer()->getJobList()->setLastRun($job); |
|
56 | + } catch(\Exception $ex) { |
|
57 | + $app->getContainer()->getServer()->getLogger()->logException($ex); |
|
58 | + } |
|
59 | 59 | }; |
60 | 60 | |
61 | 61 | $eventDispatcher->addListener('\OCP\Calendar\Resource\ForceRefreshEvent', $eventHandler); |
@@ -63,18 +63,18 @@ discard block |
||
63 | 63 | |
64 | 64 | $cm = \OC::$server->getContactsManager(); |
65 | 65 | $cm->register(function() use ($cm, $app) { |
66 | - $user = \OC::$server->getUserSession()->getUser(); |
|
67 | - if (!is_null($user)) { |
|
68 | - $app->setupContactsProvider($cm, $user->getUID()); |
|
69 | - } else { |
|
70 | - $app->setupSystemContactsProvider($cm); |
|
71 | - } |
|
66 | + $user = \OC::$server->getUserSession()->getUser(); |
|
67 | + if (!is_null($user)) { |
|
68 | + $app->setupContactsProvider($cm, $user->getUID()); |
|
69 | + } else { |
|
70 | + $app->setupSystemContactsProvider($cm); |
|
71 | + } |
|
72 | 72 | }); |
73 | 73 | |
74 | 74 | $calendarManager = \OC::$server->getCalendarManager(); |
75 | 75 | $calendarManager->register(function() use ($calendarManager, $app) { |
76 | - $user = \OC::$server->getUserSession()->getUser(); |
|
77 | - if ($user !== null) { |
|
78 | - $app->setupCalendarProvider($calendarManager, $user->getUID()); |
|
79 | - } |
|
76 | + $user = \OC::$server->getUserSession()->getUser(); |
|
77 | + if ($user !== null) { |
|
78 | + $app->setupCalendarProvider($calendarManager, $user->getUID()); |
|
79 | + } |
|
80 | 80 | }); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $job = $app->getContainer()->query(\OCA\DAV\BackgroundJob\UpdateCalendarResourcesRoomsBackgroundJob::class); |
54 | 54 | $job->run(); |
55 | 55 | $app->getContainer()->getServer()->getJobList()->setLastRun($job); |
56 | - } catch(\Exception $ex) { |
|
56 | + } catch (\Exception $ex) { |
|
57 | 57 | $app->getContainer()->getServer()->getLogger()->logException($ex); |
58 | 58 | } |
59 | 59 | }; |