diff --git a/lib/servers.php b/lib/servers.php index e40cb7225c..b578e950e0 100644 --- a/lib/servers.php +++ b/lib/servers.php @@ -190,10 +190,10 @@ public static function init($name, $user_config) { * @param int $id server id * @return void */ - public static function add($atts) { + public static function add($atts, $save = true) { $atts['object'] = false; $atts['connected'] = false; - return self::repo_add($atts); + return self::repo_add($atts, $save); } /** diff --git a/modules/contacts/hm-contacts.php b/modules/contacts/hm-contacts.php index 166007564c..06c77d5029 100644 --- a/modules/contacts/hm-contacts.php +++ b/modules/contacts/hm-contacts.php @@ -24,7 +24,7 @@ class Hm_Contact_Store { public function init($user_config, $session) { self::initRepo('contacts', $user_config, $session, $this->data, function($initial) { foreach ($initial as $contact) { - $this->add_contact($contact); + $this->add_contact($contact, false); } }); } @@ -43,9 +43,9 @@ public static function save() { public function __construct() { } - public function add_contact($data) { + public function add_contact($data, $save = true) { $contact = new Hm_Contact($data); - self::add($contact); + self::add($contact, $save); return true; } diff --git a/modules/imap/handler_modules.php b/modules/imap/handler_modules.php index 9c6fa1e526..5df43141c7 100644 --- a/modules/imap/handler_modules.php +++ b/modules/imap/handler_modules.php @@ -1536,11 +1536,10 @@ public function process() { foreach (Hm_IMAP_List::getAll() as $id => $server) { if ($this->session->loaded) { if (array_key_exists('expiration', $server)) { - $updated = true; $server['expiration'] = 1; + Hm_IMAP_List::edit($id, $server); } } - Hm_IMAP_List::edit($id, $server); if (array_key_exists('default', $server) && $server['default']) { $has_default = true; }