Пример #1
0
 /**
  * @param Folder $folder
  */
 function GetFolderMessageCount(&$folder)
 {
     if (!$folder) {
         return;
     } elseif ($folder->SyncType == FOLDERSYNC_DirectMode) {
         if ($this->MailStorage->Connect()) {
             switch ($this->_account->MailProtocol) {
                 case MAILPROTOCOL_IMAP4:
                     $this->MailStorage->GetFolderMessageCount($folder);
                     break;
                 case MAILPROTOCOL_POP3:
                     if ($folder->Type == FOLDERTYPE_Inbox) {
                         $sizesArray =& $this->MailStorage->_getPop3Sizes();
                         $folder->MessageCount = count($sizesArray);
                     } else {
                         $folder->MessageCount = 0;
                     }
                     $folder->UnreadMessageCount = 0;
                     break;
                 case MAILPROTOCOL_WMSERVER:
                     if ($folder->Type == FOLDERTYPE_Inbox) {
                         $folder->MessageCount =& $this->MailStorage->getAllMessagesCount();
                     } else {
                         $folder->MessageCount = 0;
                     }
                     $folder->UnreadMessageCount = 0;
                     break;
             }
         }
     } elseif ($this->DbStorage->Connect()) {
         $this->DbStorage->GetFolderMessageCount($folder);
     }
 }
Пример #2
0
 /**
  * @param Folder $folder
  */
 function GetFolderMessageCount(&$folder)
 {
     if (!$folder) {
         return;
     } else {
         if ($folder->SyncType == FOLDERSYNC_DirectMode) {
             switch ($this->_account->MailProtocol) {
                 case MAILPROTOCOL_POP3:
                 case MAILPROTOCOL_IMAP4:
                     if ($this->MailStorage->Connect()) {
                         $this->MailStorage->GetFolderMessageCount($folder);
                     }
                     break;
             }
         } else {
             if ($this->DbStorage->Connect()) {
                 $this->DbStorage->GetFolderMessageCount($folder);
             }
         }
     }
 }