Skip to content

Commit 8ea39f8

Browse files
committed
fix(frontend): resolve conflitct
1 parent 52de2e7 commit 8ea39f8

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

modules/core/hm-mailbox.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,13 @@ public function select_folder($folder) {
631631
return true;
632632
}
633633

634+
public function is_archive_folder($id, $user_config, $current_folder) {
635+
if ($this->is_imap()) {
636+
return $this->connection->is_archive_folder($id, $user_config, $current_folder);
637+
}
638+
return false;
639+
}
640+
634641
public function get_config() {
635642
return $this->config;
636643
}

modules/imap/handler_modules.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,6 +1925,8 @@ public function process() {
19251925
$save_reply_text = true;
19261926
}
19271927
$msg_headers = $mailbox->get_message_headers(hex2bin($form['folder']), $form['imap_msg_uid']);
1928+
1929+
$this->out('is_archive_folder', $mailbox->is_archive_folder($form['imap_server_id'], $this->user_config, $form['folder']));
19281930
$this->out('folder_status', array('imap_'.$form['imap_server_id'].'_'.$form['folder'] => $mailbox->get_folder_state()));
19291931
$this->out('msg_struct', $msg_struct);
19301932
$this->out('list_headers', get_list_headers($msg_headers));

modules/imap/hm-imap.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,5 +2667,16 @@ public function server_support_children_capability() {
26672667

26682668
return false;
26692669
}
2670+
2671+
public function is_archive_folder($id, $user_config, $current_folder) {
2672+
2673+
if (isset($user_config->get('special_imap_folders', array())[$id]['archive'])) {
2674+
$archive_folder = $user_config->get('special_imap_folders', array())[$id]['archive'];
2675+
if (bin2hex($archive_folder) == $current_folder) {
2676+
return true;
2677+
}
2678+
}
2679+
return false;
2680+
}
26702681
}
26712682
}

modules/imap/output_modules.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,14 @@ protected function output() {
386386
$txt .= '<div class="position-relative"><a class="hlink text-decoration-none btn btn-sm btn-outline-secondary dropdown-toggle" id="copy_message" href="#" data-bs-toggle="dropdown">'.$this->trans('Copy').'</a><div class="move_to_location dropdown-menu" data-bs-auto-close="outside"></div></div>';
387387
$txt .= '<div class="position-relative"><a class="hlink text-decoration-none btn btn-sm btn-outline-secondary dropdown-toggle" id="move_message" href="#" data-bs-toggle="dropdown">'.$this->trans('Move').'</a><div class="move_to_location dropdown-menu" data-bs-auto-close="outside"></div></div>';
388388
$txt .= '<a class="archive_link hlink text-decoration-none btn btn-sm btn-outline-secondary" id="archive_message" href="#">'.$this->trans('Archive').'</a>';
389+
$txt .= '<a class="hlink text-decoration-none" id="unread_message" href="#">'.$this->trans('Unread').'</a>';
390+
$txt .= '<a class="delete_link hlink text-decoration-none" id="delete_message" href="#">'.$this->trans('Delete').'</a>';
391+
$txt .= '<div class="position-relative"><a class="hlink" id="copy_message" href="#">'.$this->trans('Copy').'</a><div class="move_to_location"></div></div>';
392+
$txt .= '<div class="position-relative"><a class="hlink" id="move_message" href="#">'.$this->trans('Move').'</a><div class="move_to_location"></div></div>';
393+
394+
if (!$this->get('is_archive_folder')) {
395+
$txt .= '<a class="archive_link hlink text-decoration-none" id="archive_message" href="#">'.$this->trans('Archive').'</a>';
396+
}
389397

390398
if($this->get('tags')){
391399
$txt .= tags_dropdown($this, $headers);

0 commit comments

Comments
 (0)