Changeset 1617 in subversion


Ignore:
Timestamp:
Jul 31, 2008 11:23:06 AM (5 years ago)
Author:
thomasb
Message:

Fix read_when_deleted behavior + javascript codestyle

Location:
trunk/roundcubemail
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/config/main.inc.php.dist

    r1584 r1617  
    176176// the message for deletion rather than deleting it immediately.  Setting this to  
    177177// false causes deleted messages to be permanantly removed if there is no Trash folder 
    178 $rcmail_config['flag_for_deletion'] = TRUE; 
     178$rcmail_config['flag_for_deletion'] = FALSE; 
    179179 
    180180// Behavior if a received message requests a message delivery notification (read receipt) 
  • trunk/roundcubemail/program/include/rcmail.php

    r1613 r1617  
    244244      $this->output = new rcube_template($this->task, $framed); 
    245245 
    246     foreach (array('flag_for_deletion') as $js_config_var) { 
     246    foreach (array('flag_for_deletion','read_when_deleted') as $js_config_var) { 
    247247      $this->output->set_env($js_config_var, $this->config->get($js_config_var)); 
    248248    } 
  • trunk/roundcubemail/program/js/app.js

    r1611 r1617  
    12831283        { 
    12841284        if (window.frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)<0) 
    1285           window.frames[this.env.contentframe].location.href = this.env.blankpage; 
    1286         } 
     1285          window.frames[this.env.contentframe].location.href = this.env.blankpage; 
     1286        } 
    12871287      else if (!bw.safari) 
    12881288        frm.style.display = show ? 'block' : 'none'; 
     
    15071507  // @private 
    15081508  this._with_selected_messages = function(action, lock, add_url, remove) 
    1509     { 
     1509  { 
    15101510    var a_uids = new Array(); 
    15111511 
     
    15131513      a_uids[0] = this.env.uid; 
    15141514    else 
    1515       { 
     1515    { 
    15161516      var selection = this.message_list.get_selection(); 
    15171517      var rows = this.message_list.rows; 
     
    15221522        a_uids[a_uids.length] = id; 
    15231523 
    1524         if (remove) 
     1524        if (remove) 
    15251525          this.message_list.remove_row(id, (n == selection.length-1)); 
    15261526        else 
    1527           { 
    1528           rows[id].deleted = true; 
     1527        { 
     1528          rows[id].deleted = true; 
    15291529         
    15301530          if (rows[id].classname.indexOf('deleted')<0) 
    1531             { 
     1531          { 
    15321532            rows[id].classname += ' deleted'; 
    15331533            this.set_classname(rows[id].obj, 'deleted', true); 
    1534             } 
     1534          } 
     1535          if (this.env.read_when_deleted) 
     1536          { 
     1537            rows[id].classname = rows[id].classname.replace(/\s*unread/, ''); 
     1538            this.set_classname(rows[id].obj, 'unread', false); 
     1539          } 
    15351540         
    1536           if (rows[id].icon && this.env.deletedicon) 
     1541          if (rows[id].icon && this.env.deletedicon) 
    15371542            rows[id].icon.src = this.env.deletedicon; 
    1538           } 
    1539         } 
    1540       } 
     1543        } 
     1544      } 
     1545    } 
    15411546     
    15421547    // also send search request to get the right messages  
     
    15461551    // send request to server 
    15471552    this.http_post(action, '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, lock); 
    1548     }; 
     1553  }; 
    15491554 
    15501555 
     
    15751580        id = a_uids[n]; 
    15761581        if ((flag=='read' && this.message_list.rows[id].unread)  
    1577             || (flag=='unread' && !this.message_list.rows[id].unread) 
    1578         || (flag=='delete' && !this.message_list.rows[id].deleted) 
    1579             || (flag=='undelete' && this.message_list.rows[id].deleted) 
    1580             || (flag=='flagged' && !this.message_list.rows[id].flagged) 
    1581             || (flag=='unflagged' && this.message_list.rows[id].flagged)) 
    1582           { 
    1583             r_uids[r_uids.length] = id; 
    1584           } 
     1582            || (flag=='unread' && !this.message_list.rows[id].unread) 
     1583            || (flag=='delete' && !this.message_list.rows[id].deleted) 
     1584            || (flag=='undelete' && this.message_list.rows[id].deleted) 
     1585            || (flag=='flagged' && !this.message_list.rows[id].flagged) 
     1586            || (flag=='unflagged' && this.message_list.rows[id].flagged)) 
     1587        { 
     1588          r_uids[r_uids.length] = id; 
     1589        } 
    15851590      } 
    15861591 
     
    16371642 
    16381643        if (rows[uid].icon && icn_src  
    1639             && !(rows[uid].replied && this.env.repliedicon) 
     1644            && !(rows[uid].replied && this.env.repliedicon) 
    16401645            && !(rows[uid].deleted && this.env.deletedicon)) 
    16411646          rows[uid].icon.src = icn_src; 
     
    16581663 
    16591664        if (rows[uid].replied && parent.rcmail.env.repliedicon) 
    1660           icn_src = parent.rcmail.env.repliedicon; 
     1665          icn_src = parent.rcmail.env.repliedicon; 
    16611666        else if (rows[uid].deleted && parent.rcmail.env.deletedicon) 
    1662           icn_src = parent.rcmail.env.deletedicon; 
     1667          icn_src = parent.rcmail.env.deletedicon; 
    16631668        else if (parent.rcmail.env.messageicon) 
    16641669          icn_src = parent.rcmail.env.messageicon; 
    16651670       
    1666         if (rows[uid].icon && icn_src) 
     1671        if (rows[uid].icon && icn_src) 
    16671672          rows[uid].icon.src = icn_src; 
    16681673      } 
     
    17801785         
    17811786        if (rows[uid].classname.indexOf('deleted')<0) 
    1782           { 
     1787          { 
    17831788          rows[uid].classname += ' deleted'; 
    17841789          this.set_classname(rows[uid].obj, 'deleted', true); 
    17851790          } 
    1786          
    1787         if (rows[uid].icon && this.env.deletedicon) 
     1791        if (this.env.read_when_deleted) 
     1792        { 
     1793          rows[uid].classname = rows[uid].classname.replace(/\s*unread/, ''); 
     1794          this.set_classname(rows[uid].obj, 'unread', false); 
     1795        } 
     1796           
     1797        if (rows[uid].icon && this.env.deletedicon) 
    17881798          rows[uid].icon.src = this.env.deletedicon; 
    17891799 
    1790         if (rows[uid].unread) 
    1791           r_uids[r_uids.length] = uid; 
     1800        if (rows[uid].unread) 
     1801          r_uids[r_uids.length] = uid; 
    17921802        } 
    17931803      } 
     
    18181828        { 
    18191829        rows[uid].unread = false; 
    1820         rows[uid].read = true; 
     1830        rows[uid].read = true; 
    18211831         
    18221832        rows[uid].classname = rows[uid].classname.replace(/\s*unread/, ''); 
  • trunk/roundcubemail/program/steps/mail/move_del.inc

    r1359 r1617  
    3030    $moved = $IMAP->move_message($uids, $target, get_input_value('_mbox', RCUBE_INPUT_POST)); 
    3131   
    32     if (!$moved) { 
     32    if ($moved) { 
     33        // flag old messages as read because rcube_imap will not send expunge command after moving 
     34        if ($CONFIG['read_when_deleted']) 
     35            $IMAP->set_flag($uids, 'SEEN'); 
     36    } 
     37    else { 
    3338        // send error message 
    3439        $OUTPUT->command('list_mailbox'); 
Note: See TracChangeset for help on using the changeset viewer.