Aleksander Machniak
2016-03-28 46f7b7096450939fe03c95aa81ce06ae4bfca89d
program/lib/Roundcube/rcube_imap_cache.php
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2012, The Roundcube Dev Team                       |
@@ -99,7 +99,6 @@
    );
    /**
     * Object constructor.
     *
@@ -132,7 +131,6 @@
        $this->messages_table = $db->table_name('cache_messages', true);
    }
    /**
     * Cleanup actions (on shutdown).
     */
@@ -141,7 +139,6 @@
        $this->save_icache();
        $this->icache = null;
    }
    /**
     * Set cache mode
@@ -152,7 +149,6 @@
    {
        $this->mode = $mode;
    }
    /**
     * Return (sorted) messages index (UIDs).
@@ -262,7 +258,6 @@
        return $data;
    }
    /**
     * Return messages thread.
     * If threaded index doesn't exist or is invalid, will be updated.
@@ -317,7 +312,6 @@
        return $index['object'];
    }
    /**
     * Returns list of messages (headers). See rcube_imap::fetch_headers().
@@ -380,7 +374,6 @@
        return $result;
    }
    /**
     * Returns message data.
@@ -449,7 +442,6 @@
        return $message;
    }
    /**
     * Saves the message in cache.
     *
@@ -498,7 +490,7 @@
        }
        $this->db->set_option('ignore_key_errors', true);
console($msg);
        // insert new record
        $res = $this->db->query(
            "INSERT INTO {$this->messages_table}"
@@ -521,7 +513,6 @@
        $this->db->set_option('ignore_key_errors', false);
    }
    /**
     * Sets the flag for specified message.
@@ -575,7 +566,6 @@
            $this->userid, $mailbox);
    }
    /**
     * Removes message(s) from cache.
     *
@@ -611,7 +601,6 @@
                $this->userid, $mailbox);
        }
    }
    /**
     * Clears index cache.
@@ -652,7 +641,6 @@
        }
    }
    /**
     * Clears thread cache.
     *
@@ -677,7 +665,6 @@
        }
    }
    /**
     * Clears the cache.
     *
@@ -690,7 +677,6 @@
        $this->remove_thread($mailbox);
        $this->remove_message($mailbox, $uids);
    }
    /**
     * Delete expired cache entries
@@ -710,7 +696,6 @@
        $db->query("DELETE FROM ".$db->table_name('cache_thread', true)
              ." WHERE `expires` < $now");
    }
    /**
     * Fetches index data from database
@@ -748,7 +733,6 @@
        return null;
    }
    /**
     * Fetches thread data from database
     */
@@ -781,7 +765,6 @@
        return null;
    }
    /**
     * Saves index data into database
@@ -836,7 +819,6 @@
        $this->db->set_option('ignore_key_errors', false);
    }
    /**
     * Saves thread data into database
     */
@@ -886,7 +868,6 @@
        $this->db->set_option('ignore_key_errors', false);
    }
    /**
     * Checks index/thread validity
@@ -1005,14 +986,13 @@
                return false;
            }
            // ... and max UID
            if ($object->max() != $this->imap->id2uid($mbox_data['EXISTS'], $mailbox, true)) {
            if ($object->max() != $this->imap->id2uid($mbox_data['EXISTS'], $mailbox)) {
                return false;
            }
        }
        return true;
    }
    /**
     * Synchronizes the mailbox.
@@ -1190,7 +1170,6 @@
        $this->icache[$mailbox]['index']['object'] = $data;
    }
    /**
     * Converts cache row into message object.
     *
@@ -1214,7 +1193,6 @@
        return $message;
    }
    /**
     * Saves message stored in internal cache
     */
@@ -1235,7 +1213,6 @@
            $this->icache['__message']['md5sum'] = $md5sum;
        }
    }
    /**
     * Prepares message object to be stored in database.
@@ -1276,7 +1253,6 @@
        }
    }
    /**
     * Fetches index data from IMAP server
     */
@@ -1297,7 +1273,6 @@
        return $index;
    }
    /**
     * Fetches thread data from IMAP server
     */
@@ -1314,7 +1289,6 @@
        return new rcube_result_thread($mailbox, '* THREAD');
    }
}
// for backward compat.