| Total Complexity | 114 |
| Total Lines | 682 |
| 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) { |
||
| 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 | return match ($foldertype) { |
||
| 465 | SYNC_FOLDER_TYPE_TASK, SYNC_FOLDER_TYPE_USER_TASK => "IPF.Task", |
||
| 466 | SYNC_FOLDER_TYPE_APPOINTMENT, SYNC_FOLDER_TYPE_USER_APPOINTMENT => "IPF.Appointment", |
||
| 467 | SYNC_FOLDER_TYPE_CONTACT, SYNC_FOLDER_TYPE_USER_CONTACT => "IPF.Contact", |
||
| 468 | SYNC_FOLDER_TYPE_NOTE, SYNC_FOLDER_TYPE_USER_NOTE => "IPF.StickyNote", |
||
| 469 | SYNC_FOLDER_TYPE_JOURNAL, SYNC_FOLDER_TYPE_USER_JOURNAL => "IPF.Journal", |
||
| 470 | default => "IPF.Note", |
||
| 471 | }; |
||
| 472 | } |
||
| 473 | |||
| 474 | /** |
||
| 475 | * Returns the ActiveSync (USER) Foldertype from MAPI PR_CONTAINER_CLASS. |
||
| 476 | * |
||
| 477 | * @param mixed $class |
||
| 478 | * |
||
| 479 | * @return int |
||
| 480 | */ |
||
| 481 | public static function GetFolderTypeFromContainerClass($class) { |
||
| 482 | if ($class == "IPF.Note") { |
||
| 483 | return SYNC_FOLDER_TYPE_USER_MAIL; |
||
| 484 | } |
||
| 485 | if ($class == "IPF.Task") { |
||
| 486 | return SYNC_FOLDER_TYPE_USER_TASK; |
||
| 487 | } |
||
| 488 | if ($class == "IPF.Appointment") { |
||
| 489 | return SYNC_FOLDER_TYPE_USER_APPOINTMENT; |
||
| 490 | } |
||
| 491 | if ($class == "IPF.Contact") { |
||
| 492 | return SYNC_FOLDER_TYPE_USER_CONTACT; |
||
| 493 | } |
||
| 494 | if ($class == "IPF.StickyNote") { |
||
| 495 | return SYNC_FOLDER_TYPE_USER_NOTE; |
||
| 496 | } |
||
| 497 | if ($class == "IPF.Journal") { |
||
| 498 | return SYNC_FOLDER_TYPE_USER_JOURNAL; |
||
| 499 | } |
||
| 500 | |||
| 501 | return SYNC_FOLDER_TYPE_OTHER; |
||
| 502 | } |
||
| 503 | |||
| 504 | /** |
||
| 505 | * Calculates the native body type of a message using available properties. Refer to oxbbody. |
||
| 506 | * |
||
| 507 | * @param array $messageprops |
||
| 508 | * |
||
| 509 | * @return int |
||
| 510 | */ |
||
| 511 | public static function GetNativeBodyType($messageprops) { |
||
| 512 | // check if the properties are set and get the error code if needed |
||
| 513 | if (!isset($messageprops[PR_BODY])) { |
||
| 514 | $messageprops[PR_BODY] = self::GetError(PR_BODY, $messageprops); |
||
| 515 | } |
||
| 516 | if (!isset($messageprops[PR_RTF_COMPRESSED])) { |
||
| 517 | $messageprops[PR_RTF_COMPRESSED] = self::GetError(PR_RTF_COMPRESSED, $messageprops); |
||
| 518 | } |
||
| 519 | if (!isset($messageprops[PR_HTML])) { |
||
| 520 | $messageprops[PR_HTML] = self::GetError(PR_HTML, $messageprops); |
||
| 521 | } |
||
| 522 | if (!isset($messageprops[PR_RTF_IN_SYNC])) { |
||
| 523 | $messageprops[PR_RTF_IN_SYNC] = self::GetError(PR_RTF_IN_SYNC, $messageprops); |
||
| 524 | } |
||
| 525 | |||
| 526 | if ( // 1 |
||
| 527 | ($messageprops[PR_BODY] == MAPI_E_NOT_FOUND) && |
||
| 528 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_FOUND) && |
||
| 529 | ($messageprops[PR_HTML] == MAPI_E_NOT_FOUND)) { |
||
| 530 | return SYNC_BODYPREFERENCE_PLAIN; |
||
| 531 | } |
||
| 532 | if ( // 2 |
||
| 533 | ($messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 534 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_FOUND) && |
||
| 535 | ($messageprops[PR_HTML] == MAPI_E_NOT_FOUND)) { |
||
| 536 | return SYNC_BODYPREFERENCE_PLAIN; |
||
| 537 | } |
||
| 538 | if ( // 3 |
||
| 539 | ($messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 540 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 541 | ($messageprops[PR_HTML] == MAPI_E_NOT_FOUND)) { |
||
| 542 | return SYNC_BODYPREFERENCE_PLAIN; |
||
| 543 | } |
||
| 544 | if ( // 4 |
||
| 545 | ($messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 546 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 547 | ($messageprops[PR_HTML] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 548 | $messageprops[PR_RTF_IN_SYNC]) { |
||
| 549 | return SYNC_BODYPREFERENCE_PLAIN; |
||
| 550 | } |
||
| 551 | if ( // 5 |
||
| 552 | ($messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 553 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 554 | ($messageprops[PR_HTML] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 555 | (!$messageprops[PR_RTF_IN_SYNC])) { |
||
| 556 | return SYNC_BODYPREFERENCE_HTML; |
||
| 557 | } |
||
| 558 | if ( // 6 |
||
| 559 | ($messageprops[PR_RTF_COMPRESSED] != MAPI_E_NOT_FOUND || $messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 560 | ($messageprops[PR_HTML] != MAPI_E_NOT_FOUND || $messageprops[PR_HTML] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 561 | $messageprops[PR_RTF_IN_SYNC]) { |
||
| 562 | return SYNC_BODYPREFERENCE_PLAIN; |
||
| 563 | } |
||
| 564 | if ( // 7 |
||
| 565 | ($messageprops[PR_RTF_COMPRESSED] != MAPI_E_NOT_FOUND || $messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 566 | ($messageprops[PR_HTML] != MAPI_E_NOT_FOUND || $messageprops[PR_HTML] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 567 | (!$messageprops[PR_RTF_IN_SYNC])) { |
||
| 568 | return SYNC_BODYPREFERENCE_HTML; |
||
| 569 | } |
||
| 570 | if ( // 8 |
||
| 571 | ($messageprops[PR_BODY] != MAPI_E_NOT_FOUND || $messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 572 | ($messageprops[PR_RTF_COMPRESSED] != MAPI_E_NOT_FOUND || $messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 573 | $messageprops[PR_RTF_IN_SYNC]) { |
||
| 574 | return SYNC_BODYPREFERENCE_PLAIN; |
||
| 575 | } |
||
| 576 | if ( // 9.1 |
||
| 577 | ($messageprops[PR_BODY] != MAPI_E_NOT_FOUND || $messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 578 | ($messageprops[PR_RTF_COMPRESSED] != MAPI_E_NOT_FOUND || $messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 579 | (!$messageprops[PR_RTF_IN_SYNC])) { |
||
| 580 | return SYNC_BODYPREFERENCE_PLAIN; |
||
| 581 | } |
||
| 582 | if ( // 9.2 |
||
| 583 | ($messageprops[PR_RTF_COMPRESSED] != MAPI_E_NOT_FOUND || $messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 584 | ($messageprops[PR_BODY] == MAPI_E_NOT_FOUND) && |
||
| 585 | ($messageprops[PR_HTML] == MAPI_E_NOT_FOUND)) { |
||
| 586 | return SYNC_BODYPREFERENCE_PLAIN; |
||
| 587 | } |
||
| 588 | if ( // 9.3 |
||
| 589 | ($messageprops[PR_BODY] != MAPI_E_NOT_FOUND || $messageprops[PR_BODY] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 590 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_FOUND) && |
||
| 591 | ($messageprops[PR_HTML] == MAPI_E_NOT_FOUND)) { |
||
| 592 | return SYNC_BODYPREFERENCE_PLAIN; |
||
| 593 | } |
||
| 594 | if ( // 9.4 |
||
| 595 | ($messageprops[PR_HTML] != MAPI_E_NOT_FOUND || $messageprops[PR_HTML] == MAPI_E_NOT_ENOUGH_MEMORY) && |
||
| 596 | ($messageprops[PR_BODY] == MAPI_E_NOT_FOUND) && |
||
| 597 | ($messageprops[PR_RTF_COMPRESSED] == MAPI_E_NOT_FOUND)) { |
||
| 598 | return SYNC_BODYPREFERENCE_HTML; |
||
| 599 | } |
||
| 600 | |||
| 601 | // 10 |
||
| 602 | return SYNC_BODYPREFERENCE_PLAIN; |
||
| 603 | } |
||
| 604 | |||
| 605 | /** |
||
| 606 | * Returns the error code for a given property. |
||
| 607 | * Helper for MAPIUtils::GetNativeBodyType() function but also used in other places. |
||
| 608 | * |
||
| 609 | * @param int $tag |
||
| 610 | * @param array $messageprops |
||
| 611 | * |
||
| 612 | * @return int (MAPI_ERROR_CODE) |
||
| 613 | */ |
||
| 614 | public static function GetError($tag, $messageprops) { |
||
| 624 | } |
||
| 625 | |||
| 626 | /** |
||
| 627 | * Function will be used to decode smime messages and convert it to normal messages. |
||
| 628 | * |
||
| 629 | * @param MAPISession $session |
||
| 630 | * @param MAPIStore $store |
||
| 631 | * @param MAPIAdressBook $addressBook |
||
| 632 | * @param mixed $mapimessage |
||
| 633 | */ |
||
| 634 | public static function ParseSmime($session, $store, $addressBook, &$mapimessage) { |
||
| 694 | } |
||
| 695 | } |
||
| 699 |
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