|
31 | 31 | use Sabre\DAV\Server; |
32 | 32 | use Sabre\DAV\Xml\Property\LocalHref; |
33 | 33 | use Sabre\DAVACL\IPrincipal; |
34 | | -use Sabre\HTTP\RequestInterface; |
35 | | -use Sabre\HTTP\ResponseInterface; |
36 | | -use Sabre\VObject\Component\VCalendar; |
37 | | -use Sabre\VObject\Reader; |
38 | 34 |
|
39 | 35 | class Plugin extends \Sabre\CalDAV\Schedule\Plugin { |
40 | 36 |
|
@@ -139,67 +135,4 @@ function propFindDefaultCalendarUrl(PropFind $propFind, INode $node) { |
139 | 135 | }); |
140 | 136 | } |
141 | 137 | } |
142 | | - |
143 | | - /** |
144 | | - * This method is triggered whenever there was a calendar object gets |
145 | | - * created or updated. |
146 | | - * |
147 | | - * Basically just a copy of parent::calendarObjectChange, with the change |
148 | | - * from: |
149 | | - * $addresses = $this->getAddressesForPrincipal($calendarNode->getOwner()); |
150 | | - * to: |
151 | | - * $addresses = $this->getAddressesForPrincipal($calendarNode->getPrincipalURI()); |
152 | | - * |
153 | | - * @param RequestInterface $request HTTP request |
154 | | - * @param ResponseInterface $response HTTP Response |
155 | | - * @param VCalendar $vCal Parsed iCalendar object |
156 | | - * @param mixed $calendarPath Path to calendar collection |
157 | | - * @param mixed $modified The iCalendar object has been touched. |
158 | | - * @param mixed $isNew Whether this was a new item or we're updating one |
159 | | - * @return void |
160 | | - */ |
161 | | - function calendarObjectChange(RequestInterface $request, ResponseInterface $response, VCalendar $vCal, $calendarPath, &$modified, $isNew) { |
162 | | - |
163 | | - if (!$this->scheduleReply($this->server->httpRequest)) { |
164 | | - return; |
165 | | - } |
166 | | - |
167 | | - $calendarNode = $this->server->tree->getNodeForPath($calendarPath); |
168 | | - |
169 | | - $addresses = $this->getAddressesForPrincipal( |
170 | | - $calendarNode->getPrincipalURI() |
171 | | - ); |
172 | | - |
173 | | - if (!$isNew) { |
174 | | - $node = $this->server->tree->getNodeForPath($request->getPath()); |
175 | | - $oldObj = Reader::read($node->get()); |
176 | | - } else { |
177 | | - $oldObj = null; |
178 | | - } |
179 | | - |
180 | | - $this->processICalendarChange($oldObj, $vCal, $addresses, [], $modified); |
181 | | - |
182 | | - if ($oldObj) { |
183 | | - // Destroy circular references so PHP will GC the object. |
184 | | - $oldObj->destroy(); |
185 | | - } |
186 | | - |
187 | | - } |
188 | | - |
189 | | - /** |
190 | | - * This method checks the 'Schedule-Reply' header |
191 | | - * and returns false if it's 'F', otherwise true. |
192 | | - * |
193 | | - * Copied from Sabre/DAV's Schedule plugin, because it's |
194 | | - * private for whatever reason |
195 | | - * |
196 | | - * @param RequestInterface $request |
197 | | - * @return bool |
198 | | - */ |
199 | | - private function scheduleReply(RequestInterface $request) { |
200 | | - |
201 | | - $scheduleReply = $request->getHeader('Schedule-Reply'); |
202 | | - return $scheduleReply !== 'F'; |
203 | | - |
204 | | - } |
205 | 138 | } |
0 commit comments