Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit to turn off JMAP #658

Merged
merged 4 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions hm3.sample.ini
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,11 @@ modules[]=feeds
; POP3 email account support
modules[]=pop3

; JMAP
; ----
; JSON Meta Application Protocol for emails
;modules[]=jmap

; IMAP
; ----
; IMAP email account support. If you want to use OAuth2 over IMAP (currently
Expand Down
2 changes: 2 additions & 0 deletions modules/imap/handler_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@ public function process() {
}
}
}
$this->out('is_jmap_supported', $this->module_is_supported('jmap'));
}
}

Expand Down Expand Up @@ -1341,6 +1342,7 @@ public function process() {
}
}


/**
* Load IMAP servers for message list pages
* @subpackage imap/handler
Expand Down
5 changes: 5 additions & 0 deletions modules/imap/output_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ protected function output() {
if ($this->get('single_server_mode')) {
return '';
}

if(!$this->get('is_jmap_supported')){
return '<div class="jmap_server_setup"><div class="jmap_section" style="display: none;">';
}

$count = count(array_filter($this->get('imap_servers', array()), function($v) { return array_key_exists('type', $v) && $v['type'] == 'jmap';}));
$count = sprintf($this->trans('%d configured'), $count);
return '<div class="jmap_server_setup"><div data-target=".jmap_section" class="server_section">'.
Expand Down