From c6a820541e186c20333b7a899c4650d6f181b992 Mon Sep 17 00:00:00 2001 From: Victor Emanouilov Date: Fri, 29 Nov 2024 18:55:02 +0200 Subject: [PATCH] ews: fix reported errors --- modules/core/hm-mailbox.php | 6 +++++- modules/imap/output_modules.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/core/hm-mailbox.php b/modules/core/hm-mailbox.php index eddcc6394..1e88cdf21 100644 --- a/modules/core/hm-mailbox.php +++ b/modules/core/hm-mailbox.php @@ -507,7 +507,11 @@ public function dump_cache($type = 'string') { } public function get_state() { - return $this->connection->get_state(); + if ($this->is_imap()) { + return $this->connection->get_state(); + } else { + return $this->authed() ? 'authenticated' : 'disconnected'; + } } public function get_capability() { diff --git a/modules/imap/output_modules.php b/modules/imap/output_modules.php index 110f135e4..c72420fc6 100644 --- a/modules/imap/output_modules.php +++ b/modules/imap/output_modules.php @@ -729,7 +729,7 @@ class Hm_Output_display_imap_status extends Hm_Output_Module { protected function output() { $res = ''; foreach ($this->get('imap_servers', array()) as $index => $vals) { - $res .= 'IMAP'.$vals['name'].''. + $res .= ''.(strtoupper($vals['type'] ?? 'IMAP')).''.$vals['name'].''. ''; } return $res;