/**
  * @see ExpressoLite\Backend\Request\LiteRequest::execute
  */
 public function execute()
 {
     $msgIds = explode(',', $this->param('ids'));
     // comma-separated into array
     $asRead = $this->param('asRead') === '1';
     return MessageUtils::addOrClearFlag($this->tineSession, $msgIds, "\\Seen", $asRead);
 }
 /**
  * @see ExpressoLite\Backend\Request\LiteRequest::execute
  */
 public function execute()
 {
     $msgIds = explode(',', $this->param('messages'));
     $forever = $this->isParamSet('forever') && $this->param('forever') === '1';
     if ($forever) {
         return MessageUtils::addOrClearFlag($this->tineSession, $msgIds, "\\Deleted", true);
     } else {
         return MessageUtils::moveMessages($this->tineSession, $msgIds, '_trash_');
     }
 }
 /**
  * @see ExpressoLite\Backend\Request\LiteRequest::execute
  */
 public function execute()
 {
     $draftFolderId = $this->param('draftFolderId');
     $subject = $this->param('subject');
     $body = $this->param('body');
     $to = $this->toArrayOfEmails($this->param('to'));
     $cc = $this->toArrayOfEmails($this->param('cc'));
     $bcc = $this->toArrayOfEmails($this->param('bcc'));
     $isImportant = $this->param('isImportant') == '1';
     $replyToId = $this->emptyAsNull($this->param('replyToId'));
     $forwardFromId = $this->emptyAsNull($this->param('forwardFromId'));
     $origDraftId = $this->emptyAsNull($this->param('origDraftId'));
     $attachs = $this->param('attachs') != '' ? json_decode($this->param('attachs')) : array();
     // array of tempFile objects
     $recordData = MessageUtils::buildMessageForSaving($this->tineSession, $subject, $body, $to, $cc, $bcc, $isImportant, $replyToId, $forwardFromId, $origDraftId, $attachs);
     $this->jsonRpc('Expressomail.saveMessageInFolder', (object) array('folderName' => 'INBOX/Drafts', 'recordData' => $recordData));
     $draftMsg = $this->processor->executeRequest('searchHeadlines', array('folderIds' => $draftFolderId, 'start' => 0, 'limit' => 1));
     // newest draft
     $result = MessageUtils::addOrClearFlag($this->tineSession, array($draftMsg[0]->id), "\\Seen", true);
     // because Tine saves new draft as unread
     return $result;
 }
 /**
  * @see ExpressoLite\Backend\Request\LiteRequest::execute
  */
 public function execute()
 {
     $asHighlighted = $this->param('asHighlighted') === '1';
     $msgIds = explode(',', $this->param('ids'));
     return MessageUtils::addOrClearFlag($this->tineSession, $msgIds, "\\Flagged", $asHighlighted);
 }