Aleksander Machniak
2015-10-02 aada285660afd5a296d57c910ef52983f9ccc7cb
Simplify change_subscription() code, removed unused vars
1 files modified
16 ■■■■■ changed files
program/lib/Roundcube/rcube_imap.php 16 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_imap.php
@@ -4274,22 +4274,16 @@
     */
    protected function change_subscription($folders, $mode)
    {
        $updated = false;
        $updated = 0;
        $folders = (array) $folders;
        if (!empty($folders)) {
            if (!$this->check_connection()) {
                return false;
            }
            foreach ((array)$folders as $i => $folder) {
                $folders[$i] = $folder;
                if ($mode == 'subscribe') {
                    $updated = $this->conn->subscribe($folder);
                }
                else if ($mode == 'unsubscribe') {
                    $updated = $this->conn->unsubscribe($folder);
                }
            foreach ($folders as $folder) {
                $updated += (int) $this->conn->{$mode}($folder);
            }
        }
@@ -4298,7 +4292,7 @@
            $this->clear_cache('mailboxes', true);
        }
        return $updated;
        return $updated == count($folders) ? true : false;
    }
    /**