Total Complexity | 132 |
Total Lines | 712 |
Duplicated Lines | 0 % |
Changes | 6 | ||
Bugs | 2 | Features | 0 |
Complex classes like MAPIUtils often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use MAPIUtils, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
12 | class MAPIUtils { |
||
13 | /** |
||
14 | * Create a MAPI restriction to use within an email folder which will |
||
15 | * return all messages since since $timestamp. |
||
16 | * |
||
17 | * @param long $timestamp Timestamp since when to include messages |
||
|
|||
18 | * |
||
19 | * @return array |
||
20 | */ |
||
21 | public static function GetEmailRestriction($timestamp) { |
||
22 | // ATTENTION: ON CHANGING THIS RESTRICTION, MAPIUtils::IsInEmailSyncInterval() also needs to be changed |
||
23 | return [ |
||
24 | RES_PROPERTY, |
||
25 | [ |
||
26 | RELOP => RELOP_GE, |
||
27 | ULPROPTAG => PR_MESSAGE_DELIVERY_TIME, |
||
28 | VALUE => $timestamp, |
||
29 | ], |
||
30 | ]; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Create a MAPI restriction to use in the calendar which will |
||
35 | * return all future calendar items, plus those since $timestamp. |
||
36 | * |
||
37 | * @param MAPIStore $store the MAPI store |
||
38 | * @param long $timestamp Timestamp since when to include messages |
||
39 | * |
||
40 | * @return array |
||
41 | */ |
||
42 | // TODO getting named properties |
||
43 | public static function GetCalendarRestriction($store, $timestamp) { |
||
44 | // This is our viewing window |
||
45 | $start = $timestamp; |
||
46 | $end = 0x7FFFFFFF; // infinite end |
||
47 | |||
48 | $props = MAPIMapping::GetAppointmentProperties(); |
||
49 | $props = getPropIdsFromStrings($store, $props); |
||
50 | |||
51 | // ATTENTION: ON CHANGING THIS RESTRICTION, MAPIUtils::IsInCalendarSyncInterval() also needs to be changed |
||
52 | return [ |
||
53 | RES_OR, |
||
54 | [ |
||
55 | // OR |
||
56 | // item.end > window.start && item.start < window.end |
||
57 | [ |
||
58 | RES_AND, |
||
59 | [ |
||
60 | [ |
||
61 | RES_PROPERTY, |
||
62 | [ |
||
63 | RELOP => RELOP_LE, |
||
64 | ULPROPTAG => $props["starttime"], |
||
65 | VALUE => $end, |
||
66 | ], |
||
67 | ], |
||
68 | [ |
||
69 | RES_PROPERTY, |
||
70 | [ |
||
71 | RELOP => RELOP_GE, |
||
72 | ULPROPTAG => $props["endtime"], |
||
73 | VALUE => $start, |
||
74 | ], |
||
75 | ], |
||
76 | ], |
||
77 | ], |
||
78 | // OR |
||
79 | [ |
||
80 | RES_OR, |
||
81 | [ |
||
82 | // OR |
||
83 | // (EXIST(recurrence_enddate_property) && item[isRecurring] == true && recurrence_enddate_property >= start) |
||
84 | [ |
||
85 | RES_AND, |
||
86 | [ |
||
87 | [ |
||
88 | RES_EXIST, |
||
89 | [ULPROPTAG => $props["recurrenceend"], |
||
90 | ], |
||
91 | ], |
||
92 | [ |
||
93 | RES_PROPERTY, |
||
94 | [ |
||
95 | RELOP => RELOP_EQ, |
||
96 | ULPROPTAG => $props["isrecurring"], |
||
97 | VALUE => true, |
||
98 | ], |
||
99 | ], |
||
100 | [ |
||
101 | RES_PROPERTY, |
||
102 | [ |
||
103 | RELOP => RELOP_GE, |
||
104 | ULPROPTAG => $props["recurrenceend"], |
||
105 | VALUE => $start, |
||
106 | ], |
||
107 | ], |
||
108 | ], |
||
109 | ], |
||
110 | // OR |
||
111 | // (!EXIST(recurrence_enddate_property) && item[isRecurring] == true && item[start] <= end) |
||
112 | [ |
||
113 | RES_AND, |
||
114 | [ |
||
115 | [ |
||
116 | RES_NOT, |
||
117 | [ |
||
118 | [ |
||
119 | RES_EXIST, |
||
120 | [ULPROPTAG => $props["recurrenceend"], |
||
121 | ], |
||
122 | ], |
||
123 | ], |
||
124 | ], |
||
125 | [ |
||
126 | RES_PROPERTY, |
||
127 | [ |
||
128 | RELOP => RELOP_LE, |
||
129 | ULPROPTAG => $props["starttime"], |
||
130 | VALUE => $end, |
||
131 | ], |
||
132 | ], |
||
133 | [ |
||
134 | RES_PROPERTY, |
||
135 | [ |
||
136 | RELOP => RELOP_EQ, |
||
137 | ULPROPTAG => $props["isrecurring"], |
||
138 | VALUE => true, |
||
139 | ], |
||
140 | ], |
||
141 | ], |
||
142 | ], |
||
143 | ], |
||
144 | ], // EXISTS OR |
||
145 | ], |
||
146 | ]; // global OR |
||
147 | } |
||
148 | |||
149 | /** |
||
150 | * Create a MAPI restriction in order to check if a contact has a picture. |
||
151 | * |
||
152 | * @return array |
||
153 | */ |
||
154 | public static function GetContactPicRestriction() { |
||
155 | return [ |
||
156 | RES_PROPERTY, |
||
157 | [ |
||
158 | RELOP => RELOP_EQ, |
||
159 | ULPROPTAG => mapi_prop_tag(PT_BOOLEAN, 0x7FFF), |
||
160 | VALUE => true, |
||
161 | ], |
||
162 | ]; |
||
163 | } |
||
164 | |||
165 | /** |
||
166 | * Create a MAPI restriction for search. |
||
167 | * |
||
168 | * @param string $query |
||
169 | * |
||
170 | * @return array |
||
171 | */ |
||
172 | public static function GetSearchRestriction($query) { |
||
173 | return [ |
||
174 | RES_AND, |
||
175 | [ |
||
176 | [ |
||
177 | RES_OR, |
||
178 | [ |
||
179 | [ |
||
180 | RES_CONTENT, |
||
181 | [ |
||
182 | FUZZYLEVEL => FL_SUBSTRING | FL_IGNORECASE, |
||
183 | ULPROPTAG => PR_DISPLAY_NAME, |
||
184 | VALUE => $query, |
||
185 | ], |
||
186 | ], |
||
187 | [ |
||
188 | RES_CONTENT, |
||
189 | [ |
||
190 | FUZZYLEVEL => FL_SUBSTRING | FL_IGNORECASE, |
||
191 | ULPROPTAG => PR_ACCOUNT, |
||
192 | VALUE => $query, |
||
193 | ], |
||
194 | ], |
||
195 | [ |
||
196 | RES_CONTENT, |
||
197 | [ |
||
198 | FUZZYLEVEL => FL_SUBSTRING | FL_IGNORECASE, |
||
199 | ULPROPTAG => PR_SMTP_ADDRESS, |
||
200 | VALUE => $query, |
||
201 | ], |
||
202 | ], |
||
203 | ], // RES_OR |
||
204 | ], |
||
205 | [ |
||
206 | RES_OR, |
||
207 | [ |
||
208 | [ |
||
209 | RES_PROPERTY, |
||
210 | [ |
||
211 | RELOP => RELOP_EQ, |
||
212 | ULPROPTAG => PR_OBJECT_TYPE, |
||
213 | VALUE => MAPI_MAILUSER, |
||
214 | ], |
||
215 | ], |
||
216 | [ |
||
217 | RES_PROPERTY, |
||
218 | [ |
||
219 | RELOP => RELOP_EQ, |
||
220 | ULPROPTAG => PR_OBJECT_TYPE, |
||
221 | VALUE => MAPI_DISTLIST, |
||
222 | ], |
||
223 | ], |
||
224 | ], |
||
225 | ], // RES_OR |
||
226 | ], // RES_AND |
||
227 | ]; |
||
228 | } |
||
229 | |||
230 | /** |
||
231 | * Create a MAPI restriction for a certain email address. |
||
232 | * |
||
233 | * @param MAPIStore $store the MAPI store |
||
234 | * @param mixed $email |
||
235 | * |
||
236 | * @return array |
||
237 | */ |
||
238 | public static function GetEmailAddressRestriction($store, $email) { |
||
267 | ], |
||
268 | ], |
||
269 | ], |
||
270 | ]; |
||
271 | } |
||
272 | |||
273 | /** |
||
274 | * Create a MAPI restriction for a certain folder type. |
||
275 | * |
||
276 | * @param string $foldertype folder type for restriction |
||
277 | * |
||
278 | * @return array |
||
279 | */ |
||
280 | public static function GetFolderTypeRestriction($foldertype) { |
||
281 | return [ |
||
282 | RES_PROPERTY, |
||
283 | [ |
||
284 | RELOP => RELOP_EQ, |
||
285 | ULPROPTAG => PR_CONTAINER_CLASS, |
||
286 | VALUE => [PR_CONTAINER_CLASS => $foldertype], |
||
287 | ], |
||
288 | ]; |
||
289 | } |
||
290 | |||
291 | /** |
||
292 | * Returns subfolders of given type for a folder or false if there are none. |
||
293 | * |
||
294 | * @param MAPIFolder $folder |
||
295 | * @param string $type |
||
296 | * |
||
297 | * @return bool|MAPITable |
||
298 | */ |
||
299 | public static function GetSubfoldersForType($folder, $type) { |
||
300 | $subfolders = mapi_folder_gethierarchytable($folder, CONVENIENT_DEPTH); |
||
301 | mapi_table_restrict($subfolders, MAPIUtils::GetFolderTypeRestriction($type)); |
||
302 | if (mapi_table_getrowcount($subfolders) > 0) { |
||
303 | return mapi_table_queryallrows($subfolders, [PR_ENTRYID]); |
||
304 | } |
||
305 | |||
306 | return false; |
||
307 | } |
||
308 | |||
309 | /** |
||
310 | * Checks if mapimessage is inside the synchronization interval |
||
311 | * also defined by MAPIUtils::GetEmailRestriction(). |
||
312 | * |
||
313 | * @param MAPIStore $store mapi store |
||
314 | * @param MAPIMessage $mapimessage the mapi message to be checked |
||
315 | * @param long $timestamp the lower time limit |
||
316 | * |
||
317 | * @return bool |
||
318 | */ |
||
319 | public static function IsInEmailSyncInterval($store, $mapimessage, $timestamp) { |
||
320 | $p = mapi_getprops($mapimessage, [PR_MESSAGE_DELIVERY_TIME]); |
||
321 | |||
322 | if (isset($p[PR_MESSAGE_DELIVERY_TIME]) && $p[PR_MESSAGE_DELIVERY_TIME] >= $timestamp) { |
||
323 | SLog::Write(LOGLEVEL_DEBUG, "MAPIUtils->IsInEmailSyncInterval: Message is in the synchronization interval"); |
||
324 | |||
325 | return true; |
||
326 | } |
||
327 | |||
328 | SLog::Write(LOGLEVEL_WARN, "MAPIUtils->IsInEmailSyncInterval: Message is OUTSIDE the synchronization interval"); |
||
329 | |||
330 | return false; |
||
331 | } |
||
332 | |||
333 | /** |
||
334 | * Checks if mapimessage is inside the synchronization interval |
||
335 | * also defined by MAPIUtils::GetCalendarRestriction(). |
||
336 | * |
||
337 | * @param MAPIStore $store mapi store |
||
338 | * @param MAPIMessage $mapimessage the mapi message to be checked |
||
339 | * @param long $timestamp the lower time limit |
||
340 | * |
||
341 | * @return bool |
||
342 | */ |
||
343 | public static function IsInCalendarSyncInterval($store, $mapimessage, $timestamp) { |
||
344 | // This is our viewing window |
||
345 | $start = $timestamp; |
||
346 | $end = 0x7FFFFFFF; // infinite end |
||
347 | |||
348 | $props = MAPIMapping::GetAppointmentProperties(); |
||
349 | $props = getPropIdsFromStrings($store, $props); |
||
350 | |||
351 | $p = mapi_getprops($mapimessage, [$props["starttime"], $props["endtime"], $props["recurrenceend"], $props["isrecurring"], $props["recurrenceend"]]); |
||
352 | |||
353 | if ( |
||
354 | ( |
||
355 | isset($p[$props["endtime"]], $p[$props["starttime"]]) && |
||
356 | // item.end > window.start && item.start < window.end |
||
357 | $p[$props["endtime"]] > $start && $p[$props["starttime"]] < $end |
||
358 | ) || |
||
359 | ( |
||
360 | isset($p[$props["isrecurring"]], $p[$props["recurrenceend"]]) && |
||
361 | // (EXIST(recurrence_enddate_property) && item[isRecurring] == true && recurrence_enddate_property >= start) |
||
362 | $p[$props["isrecurring"]] == true && $p[$props["recurrenceend"]] >= $start |
||
363 | ) || |
||
364 | ( |
||
365 | isset($p[$props["isrecurring"]], $p[$props["starttime"]]) && |
||
366 | // (!EXIST(recurrence_enddate_property) && item[isRecurring] == true && item[start] <= end) |
||
367 | !isset($p[$props["recurrenceend"]]) && $p[$props["isrecurring"]] == true && $p[$props["starttime"]] <= $end |
||
368 | ) |
||
369 | ) { |
||
370 | SLog::Write(LOGLEVEL_DEBUG, "MAPIUtils->IsInCalendarSyncInterval: Message is in the synchronization interval"); |
||
371 | |||
372 | return true; |
||
373 | } |
||
374 | |||
375 | SLog::Write(LOGLEVEL_WARN, "MAPIUtils->IsInCalendarSyncInterval: Message is OUTSIDE the synchronization interval"); |
||
376 | |||
377 | return false; |
||
378 | } |
||
379 | |||
380 | /** |
||
381 | * Checks if mapimessage is in a shared folder and private. |
||
382 | * |
||
383 | * @param string $folderid binary folderid of the message |
||
384 | * @param MAPIMessage $mapimessage the mapi message to be checked |
||
385 | * |
||
386 | * @return bool |
||
387 | */ |
||
388 | public static function IsMessageSharedAndPrivate($folderid, $mapimessage) { |
||
407 | } |
||
408 | |||
409 | /** |
||
410 | * Reads data of large properties from a stream. |
||
411 | * |
||
412 | * @param MAPIMessage $message |
||
413 | * @param long $prop |
||
414 | * |
||
415 | * @return string |
||
416 | */ |
||
417 | public static function readPropStream($message, $prop) { |
||
441 | } |
||
442 | |||
443 | /** |
||
444 | * Checks if a store supports properties containing unicode characters. |
||
445 | * |
||
446 | * @param MAPIStore $store |
||
447 | */ |
||
448 | public static function IsUnicodeStore($store) { |
||
449 | $supportmask = mapi_getprops($store, [PR_STORE_SUPPORT_MASK]); |
||
450 | if (isset($supportmask[PR_STORE_SUPPORT_MASK]) && ($supportmask[PR_STORE_SUPPORT_MASK] & STORE_UNICODE_OK)) { |
||
451 | SLog::Write(LOGLEVEL_DEBUG, "Store supports properties containing Unicode characters."); |
||
452 | define('STORE_INTERNET_CPID', INTERNET_CPID_UTF8); |
||
453 | } |
||
454 | } |
||
455 | |||
456 | /** |
||
457 | * Returns the MAPI PR_CONTAINER_CLASS string for an ActiveSync Foldertype. |
||
458 | * |
||
459 | * @param int $foldertype |
||
460 | * |
||
461 | * @return string |
||
462 | */ |
||
463 | public static function GetContainerClassFromFolderType($foldertype) { |
||
464 | switch ($foldertype) { |
||
465 | case SYNC_FOLDER_TYPE_TASK: |
||
466 | case SYNC_FOLDER_TYPE_USER_TASK: |
||
467 | return "IPF.Task"; |
||
468 | break; |
||
469 | |||
470 | case SYNC_FOLDER_TYPE_APPOINTMENT: |
||
471 | case SYNC_FOLDER_TYPE_USER_APPOINTMENT: |
||
472 | return "IPF.Appointment"; |
||
473 | break; |
||
474 | |||
475 | case SYNC_FOLDER_TYPE_CONTACT: |
||
476 | case SYNC_FOLDER_TYPE_USER_CONTACT: |
||
477 | return "IPF.Contact"; |
||
478 | break; |
||
479 | |||
480 | case SYNC_FOLDER_TYPE_NOTE: |
||
481 | case SYNC_FOLDER_TYPE_USER_NOTE: |
||
482 | return "IPF.StickyNote"; |
||
483 | break; |
||
484 | |||
485 | case SYNC_FOLDER_TYPE_JOURNAL: |
||
486 | case SYNC_FOLDER_TYPE_USER_JOURNAL: |
||
487 | return "IPF.Journal"; |
||
488 | break; |
||
489 | |||
490 | case SYNC_FOLDER_TYPE_INBOX: |
||
491 | case SYNC_FOLDER_TYPE_DRAFTS: |
||
492 | case SYNC_FOLDER_TYPE_WASTEBASKET: |
||
493 | case SYNC_FOLDER_TYPE_SENTMAIL: |
||
494 | case SYNC_FOLDER_TYPE_OUTBOX: |
||
495 | case SYNC_FOLDER_TYPE_USER_MAIL: |
||
496 | case SYNC_FOLDER_TYPE_OTHER: |
||
497 | case SYNC_FOLDER_TYPE_UNKNOWN: |
||
498 | default: |
||
499 | return "IPF.Note"; |
||
500 | break; |
||
501 | } |
||
502 | } |
||
503 | |||
504 | /** |
||
505 | * Returns the ActiveSync (USER) Foldertype from MAPI PR_CONTAINER_CLASS. |
||
506 | * |
||
507 | * @param mixed $class |
||
508 | * |
||
509 | * @return int |
||
510 | */ |
||
511 | public static function GetFolderTypeFromContainerClass($class) { |
||
512 | if ($class == "IPF.Note") { |
||
513 | return SYNC_FOLDER_TYPE_USER_MAIL; |
||
514 | } |
||
515 | if ($class == "IPF.Task") { |
||
516 | return SYNC_FOLDER_TYPE_USER_TASK; |
||
517 | } |
||
518 | if ($class == "IPF.Appointment") { |
||
519 | return SYNC_FOLDER_TYPE_USER_APPOINTMENT; |
||
520 | } |
||
521 | if ($class == "IPF.Contact") { |
||
522 | return SYNC_FOLDER_TYPE_USER_CONTACT; |
||
523 | } |
||
524 | if ($class == "IPF.StickyNote") { |
||
525 | return SYNC_FOLDER_TYPE_USER_NOTE; |
||
526 | } |
||
527 | if ($class == "IPF.Journal") { |
||
528 | return SYNC_FOLDER_TYPE_USER_JOURNAL; |
||
529 | } |
||
530 | |||
531 | return SYNC_FOLDER_TYPE_OTHER; |
||
532 | } |
||
533 | |||
534 | /** |
||
535 | * Calculates the native body type of a message using available properties. Refer to oxbbody. |
||
536 | * |
||
537 | * @param array $messageprops |
||
538 | * |
||
539 | * @return int |
||
540 | */ |
||
541 | public static function GetNativeBodyType($messageprops) { |
||
542 | // check if the properties are set and get the error code if needed |
||
543 | if (!isset($messageprops[PR_BODY])) { |
||
544 | $messageprops[PR_BODY] = self::GetError(PR_BODY, $messageprops); |
||
545 | } |
||
546 | if (!isset($messageprops[PR_RTF_COMPRESSED])) { |
||
547 | $messageprops[PR_RTF_COMPRESSED] = self::GetError(PR_RTF_COMPRESSED, $messageprops); |
||
548 | } |
||
549 | if (!isset($messageprops[PR_HTML])) { |
||
550 | $messageprops[PR_HTML] = self::GetError(PR_HTML, $messageprops); |
||
551 | } |
||
552 | if (!isset($messageprops[PR_RTF_IN_SYNC])) { |
||
553 | $messageprops[PR_RTF_IN_SYNC] = self::GetError(PR_RTF_IN_SYNC, $messageprops); |
||
554 | } |
||
555 | |||
556 | if ( // 1 |
||
557 | ($messageprops[PR_BODY] == MAPI_E_NOT_FOUND) && |
||
558 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_FOUND) && |
||
559 | ($messageprops[PR_HTML] == MAPI_E_NOT_FOUND)) { |
||
560 | return SYNC_BODYPREFERENCE_PLAIN; |
||
561 | } |
||
562 | if ( // 2 |
||
563 | ($messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
564 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_FOUND) && |
||
565 | ($messageprops[PR_HTML] == MAPI_E_NOT_FOUND)) { |
||
566 | return SYNC_BODYPREFERENCE_PLAIN; |
||
567 | } |
||
568 | if ( // 3 |
||
569 | ($messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
570 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
571 | ($messageprops[PR_HTML] == MAPI_E_NOT_FOUND)) { |
||
572 | return SYNC_BODYPREFERENCE_PLAIN; |
||
573 | } |
||
574 | if ( // 4 |
||
575 | ($messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
576 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
577 | ($messageprops[PR_HTML] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
578 | $messageprops[PR_RTF_IN_SYNC]) { |
||
579 | return SYNC_BODYPREFERENCE_PLAIN; |
||
580 | } |
||
581 | if ( // 5 |
||
582 | ($messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
583 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
584 | ($messageprops[PR_HTML] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
585 | (!$messageprops[PR_RTF_IN_SYNC])) { |
||
586 | return SYNC_BODYPREFERENCE_HTML; |
||
587 | } |
||
588 | if ( // 6 |
||
589 | ($messageprops[PR_RTF_COMPRESSED] != MAPI_E_NOT_FOUND || $messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
590 | ($messageprops[PR_HTML] != MAPI_E_NOT_FOUND || $messageprops[PR_HTML] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
591 | $messageprops[PR_RTF_IN_SYNC]) { |
||
592 | return SYNC_BODYPREFERENCE_PLAIN; |
||
593 | } |
||
594 | if ( // 7 |
||
595 | ($messageprops[PR_RTF_COMPRESSED] != MAPI_E_NOT_FOUND || $messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
596 | ($messageprops[PR_HTML] != MAPI_E_NOT_FOUND || $messageprops[PR_HTML] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
597 | (!$messageprops[PR_RTF_IN_SYNC])) { |
||
598 | return SYNC_BODYPREFERENCE_HTML; |
||
599 | } |
||
600 | if ( // 8 |
||
601 | ($messageprops[PR_BODY] != MAPI_E_NOT_FOUND || $messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
602 | ($messageprops[PR_RTF_COMPRESSED] != MAPI_E_NOT_FOUND || $messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
603 | $messageprops[PR_RTF_IN_SYNC]) { |
||
604 | return SYNC_BODYPREFERENCE_PLAIN; |
||
605 | } |
||
606 | if ( // 9.1 |
||
607 | ($messageprops[PR_BODY] != MAPI_E_NOT_FOUND || $messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
608 | ($messageprops[PR_RTF_COMPRESSED] != MAPI_E_NOT_FOUND || $messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
609 | (!$messageprops[PR_RTF_IN_SYNC])) { |
||
610 | return SYNC_BODYPREFERENCE_PLAIN; |
||
611 | } |
||
612 | if ( // 9.2 |
||
613 | ($messageprops[PR_RTF_COMPRESSED] != MAPI_E_NOT_FOUND || $messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
614 | ($messageprops[PR_BODY] == MAPI_E_NOT_FOUND) && |
||
615 | ($messageprops[PR_HTML] == MAPI_E_NOT_FOUND)) { |
||
616 | return SYNC_BODYPREFERENCE_PLAIN; |
||
617 | } |
||
618 | if ( // 9.3 |
||
619 | ($messageprops[PR_BODY] != MAPI_E_NOT_FOUND || $messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
620 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_FOUND) && |
||
621 | ($messageprops[PR_HTML] == MAPI_E_NOT_FOUND)) { |
||
622 | return SYNC_BODYPREFERENCE_PLAIN; |
||
623 | } |
||
624 | if ( // 9.4 |
||
625 | ($messageprops[PR_HTML] != MAPI_E_NOT_FOUND || $messageprops[PR_HTML] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
626 | ($messageprops[PR_BODY] == MAPI_E_NOT_FOUND) && |
||
627 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_FOUND)) { |
||
628 | return SYNC_BODYPREFERENCE_HTML; |
||
629 | } |
||
630 | |||
631 | // 10 |
||
632 | return SYNC_BODYPREFERENCE_PLAIN; |
||
633 | } |
||
634 | |||
635 | /** |
||
636 | * Returns the error code for a given property. |
||
637 | * Helper for MAPIUtils::GetNativeBodyType() function but also used in other places. |
||
638 | * |
||
639 | * @param int $tag |
||
640 | * @param array $messageprops |
||
641 | * |
||
642 | * @return int (MAPI_ERROR_CODE) |
||
643 | */ |
||
644 | public static function GetError($tag, $messageprops) { |
||
654 | } |
||
655 | |||
656 | /** |
||
657 | * Function will be used to decode smime messages and convert it to normal messages. |
||
658 | * |
||
659 | * @param MAPISession $session |
||
660 | * @param MAPIStore $store |
||
661 | * @param MAPIAdressBook $addressBook |
||
662 | * @param mixed $mapimessage |
||
663 | */ |
||
664 | public static function ParseSmime($session, $store, $addressBook, &$mapimessage) { |
||
724 | } |
||
725 | } |
||
726 | // TODO check if we need to do this for encrypted (and signed?) message as well |
||
727 | } |
||
729 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths