1212use Symfony \Component \HttpFoundation \Response ;
1313use Symfony \Component \Routing \Annotation \Route ;
1414use Symfony \Component \Routing \Generator \UrlGeneratorInterface ;
15+ use Twig \Environment as TwigEnvironment ;
1516
1617class DAVController extends AbstractController
1718{
@@ -74,6 +75,20 @@ class DAVController extends AbstractController
7475 */
7576 protected $ em ;
7677
78+ /**
79+ * The Twig engine.
80+ *
81+ * @var Twig\Environment
82+ */
83+ protected $ twig ;
84+
85+ /**
86+ * The Swift_Mailer mailer service.
87+ *
88+ * @var \Swift_Mailer
89+ */
90+ protected $ mailer ;
91+
7792 /**
7893 * Base URI of the server.
7994 *
@@ -95,7 +110,7 @@ class DAVController extends AbstractController
95110 */
96111 protected $ server ;
97112
98- public function __construct (BasicAuth $ basicAuthBackend , UrlGeneratorInterface $ router , EntityManagerInterface $ entityManager , bool $ calDAVEnabled = true , bool $ cardDAVEnabled = true , bool $ webDAVEnabled = false , ?string $ inviteAddress , ?string $ authMethod , ?string $ authRealm , ?string $ publicDir , ?string $ tmpDir )
113+ public function __construct (\ Swift_Mailer $ mailer , TwigEnvironment $ twig , BasicAuth $ basicAuthBackend , UrlGeneratorInterface $ router , EntityManagerInterface $ entityManager , bool $ calDAVEnabled = true , bool $ cardDAVEnabled = true , bool $ webDAVEnabled = false , ?string $ inviteAddress , ?string $ authMethod , ?string $ authRealm , ?string $ publicDir , ?string $ tmpDir )
99114 {
100115 $ this ->calDAVEnabled = $ calDAVEnabled ;
101116 $ this ->cardDAVEnabled = $ cardDAVEnabled ;
@@ -109,6 +124,8 @@ public function __construct(BasicAuth $basicAuthBackend, UrlGeneratorInterface $
109124 $ this ->tmpDir = $ tmpDir ;
110125
111126 $ this ->em = $ entityManager ;
127+ $ this ->twig = $ twig ;
128+ $ this ->mailer = $ mailer ;
112129 $ this ->baseUri = $ router ->generate ('dav ' , ['path ' => '' ]);
113130
114131 $ this ->basicAuthBackend = $ basicAuthBackend ;
@@ -199,7 +216,7 @@ private function initServer()
199216 $ this ->server ->addPlugin (new \Sabre \CalDAV \SharingPlugin ());
200217 $ this ->server ->addPlugin (new \Sabre \CalDAV \ICSExportPlugin ());
201218 if ($ this ->inviteAddress ) {
202- $ this ->server ->addPlugin (new DavisIMipPlugin ($ this ->inviteAddress ));
219+ $ this ->server ->addPlugin (new DavisIMipPlugin ($ this ->twig , $ this -> mailer , $ this -> inviteAddress ));
203220 }
204221 }
205222
0 commit comments