Changeset 5860 in subversion


Ignore:
Timestamp:
Feb 7, 2012 4:42:51 AM (16 months ago)
Author:
alec
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-0.7/plugins/newmail_notifier/newmail_notifier.php

    r5452 r5860  
    44 * New Mail Notifier plugin 
    55 * 
    6  * Supports two methods of notification: 
     6 * Supports three methods of notification: 
    77 * 1. Basic - focus browser window and change favicon 
    88 * 2. Sound - play wav file 
     
    1010 *              supported by Chrome and Firefox with 'HTML5 Notifications' plugin) 
    1111 * 
    12  * @version 0.3 
     12 * @version 0.4 
    1313 * @author Aleksander Machniak <alec@alec.pl> 
    1414 * 
     
    133133    function notify($args) 
    134134    { 
     135        // Already notified or non-automatic check 
    135136        if ($this->notified || !empty($_GET['_refresh'])) { 
    136137            return $args; 
     138        } 
     139 
     140        // Get folders to skip checking for 
     141        if (empty($this->exceptions)) { 
     142            $this->delimiter = $this->rc->imap->get_hierarchy_delimiter(); 
     143            foreach (array('drafts_mbox', 'sent_mbox') as $folder) { 
     144                $folder = $this->rc->config->get($folder); 
     145                if (strlen($folder) && $folder != 'INBOX') { 
     146                    $this->exceptions[] = $folder; 
     147                } 
     148            } 
     149        } 
     150 
     151        $mbox = $args['mailbox']; 
     152 
     153        // Skip exception (sent/drafts) folders (and their subfolders) 
     154        foreach ($this->exceptions as $folder) { 
     155            if (strpos($mbox.$this->delimiter, $folder.$this->delimiter) === 0) { 
     156                return $args; 
     157            } 
    137158        } 
    138159 
Note: See TracChangeset for help on using the changeset viewer.