function SetFlag(&$messageIdUid, &$folder, $flags, $action) { $messageIdSet = null; $messageUidSet = null; if ($messageIdUid != null) { $messageIdSet = array_keys($messageIdUid); $messageUidSet = array_values($messageIdUid); } $result = true; if ($folder->SyncType != FOLDERSYNC_DirectMode) { if ($this->DbStorage->Connect()) { $result &= $this->DbStorage->SetMessagesFlags($messageIdSet, false, $folder, $flags, $action); } } if ($folder->SyncType != FOLDERSYNC_DontSync && $this->_account->MailProtocol != MAILPROTOCOL_POP3) { if (count($messageUidSet) == 1 && $this->MailStorage->Connect()) { $result &= $this->MailStorage->SetMessagesFlag($messageUidSet[0], $folder, $flags, $action); } } return $result; }
/** * @param string $messageIdUidSet * @param Folder $folder * @param int $flags * @param short $action * @return bool */ function SetFlags(&$messageIdUidSet, &$folder, $flags, $action) { if ($messageIdUidSet != null) { $messageIdSet = array_keys($messageIdUidSet); $messageUidSet = array_values($messageIdUidSet); } else { $messageIdSet = null; $messageUidSet = null; } $result = true; if ($folder->SyncType != FOLDERSYNC_DirectMode) { if ($this->DbStorage->Connect()) { $result &= $this->DbStorage->SetMessagesFlags($messageIdSet, false, $folder, $flags, $action); } } if ($this->_account->MailProtocol == MAILPROTOCOL_IMAP4 && $folder->SyncType != FOLDERSYNC_DontSync) { if ($this->MailStorage->Connect()) { $result &= $this->MailStorage->SetMessagesFlags($messageUidSet, true, $folder, $flags, $action); } } return $result; }