Ejemplo n.º 1
0
 /**
  * @param	array	$messageIdUidSet
  * @param	Folder	$fromFolder
  * @param	bool	$isSpam = true
  * @return	bool
  */
 function SpamMessages(&$messageIdUidSet, &$fromFolder, $isSpam = true)
 {
     $result = true;
     if (!$this->DbStorage->Connect() || !$this->MailStorage->Connect(true)) {
         return false;
     }
     $toFolder = null;
     $folders =& $this->DbStorage->GetFolders();
     if ($isSpam) {
         $toFolder =& $folders->GetFolderByType(FOLDERTYPE_Spam);
     } else {
         $toFolder =& $folders->GetFolderByType(FOLDERTYPE_Inbox);
     }
     if ($toFolder) {
         $needSystemSpamSet = true;
         /* custom class */
         wm_Custom::StaticUseMethod('MailStorageSpamMessages', array(&$this, &$needSystemSpamSet, &$messageIdUidSet, &$fromFolder, &$toFolder, &$isSpam));
         if ($needSystemSpamSet) {
             $this->MailStorage->SpamMessages($messageIdUidSet, $fromFolder, $isSpam);
         }
         $result = $this->MoveMessages($messageIdUidSet, $fromFolder, $toFolder);
     }
     return $result;
 }