Skip to content

Commit 668a7ce

Browse files
Merge branch 'master' into cypht-filter-start-from-one
2 parents 8abacc8 + 19a4645 commit 668a7ce

File tree

28 files changed

+575
-227
lines changed

28 files changed

+575
-227
lines changed

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/app.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,9 @@
434434
| 'cache_class' => env('CACHE_CLASS')
435435
*/
436436

437+
'allow_session_cache' => env('ALLOW_SESSION_CACHE', false),
437438

439+
'cache_class' => env('CACHE_CLASS'),
438440
/*
439441
| -------------
440442
| Redis Support

config/database.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@
7474
| Postgresql:
7575
| CREATE TABLE hm_user_session (hm_id varchar(250) primary key not null, data text, hm_version INTEGER DEFAULT 1, date timestamp);
7676
|
77-
| MySQL or SQLite:
77+
| MySQL:
78+
| CREATE TABLE hm_user_session (hm_id varchar(180), data longblob, hm_version INTEGER DEFAULT 1, date timestamp, primary key (hm_id));
79+
|
80+
| SQLite:
7881
| CREATE TABLE hm_user_session (hm_id varchar(180), data longblob, hm_version INTEGER DEFAULT 1, lock INTEGER DEFAULT 0, date timestamp, primary key (hm_id));
7982
|
8083
|

modules/advanced_search/modules.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,20 @@ class Hm_Output_filter_imap_advanced_search extends Hm_Output_Module {
370370
*/
371371
protected function output() {
372372
if ($this->get('imap_search_results')) {
373-
prepare_imap_message_list($this->get('imap_search_results'), $this, 'advanced_search');
373+
$adv_search_result = format_imap_message_list(
374+
$this->get('imap_search_results'),
375+
$this,
376+
'advanced_search',
377+
'email'
378+
);
379+
380+
// Convert format (ID => [HTML, ID]) to format expected (HTML => ID)
381+
$res = array();
382+
foreach ($adv_search_result as $id => $row_data) {
383+
$res[$row_data[0]] = $id;
384+
}
385+
386+
$this->out('formatted_message_list', $res);
374387
}
375388
elseif (!$this->get('formatted_message_list')) {
376389
$this->out('formatted_message_list', array());

modules/advanced_search/site.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@ var expand_adv_folder = function(res) {
7676
var list_container = $('.adv_folder_list');
7777
var folders = $(res.imap_expanded_folder_formatted);
7878
folders.find('.manage_folders_li').remove();
79-
$('.'+Hm_Utils.clean_selector(res.imap_expanded_folder_path), $('.adv_folder_list')).append(folders);
79+
const foldersWrapper = $('.'+Hm_Utils.clean_selector(res.imap_expanded_folder_path), $('.adv_folder_list'));
80+
foldersWrapper.append(folders);
8081
$('.imap_folder_link', list_container).addClass('adv_folder_link').removeClass('imap_folder_link');
8182
$('.adv_folder_link', list_container).off('click');
8283
$('.adv_folder_link', list_container).on("click", function() { return expand_adv_folder_list($(this).data('target')); });
8384
$('a', list_container).not('.adv_folder_link').off('click');
8485
$('a', list_container).not('.adv_folder_link').on("click", function() { adv_folder_select($(this).data('id')); return false; });
85-
modifyInnerLists();
86+
modifyInnerLists(foldersWrapper);
8687
}
8788
};
8889

@@ -134,7 +135,7 @@ var adv_select_imap_folder = function(el) {
134135
$(this).find('.wrapper').append(checkboxesWrapper);
135136
});
136137

137-
modifyInnerLists();
138+
modifyInnerLists(folders);
138139

139140
$('.imap_folder_link', folders).addClass('adv_folder_link').removeClass('imap_folder_link');
140141
$('.adv_folder_list').html(folders.html());
@@ -150,8 +151,8 @@ var adv_select_imap_folder = function(el) {
150151
});
151152
};
152153

153-
function modifyInnerLists() {
154-
$('.adv_folder_list').find('.inner_list li').each(function(index) {
154+
function modifyInnerLists(foldersWrapper) {
155+
foldersWrapper.find('.inner_list li').each(function(index) {
155156
const subFoldersCheckbox = `
156157
<span class="form-check form-text">
157158
<label class="form-check-label" for="include_subfolders-${index}">Include subfolders</label>

modules/contacts/modules.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,18 @@ public function process() {
9797
*/
9898
class Hm_Handler_find_message_contacts extends Hm_Handler_Module {
9999
public function process() {
100-
$contacts = array();
101100
$existing = $this->get('contact_store');
102101
$addr_headers = array('to', 'cc', 'bcc', 'sender', 'reply-to', 'from');
103102
$headers = $this->get('msg_headers', array());
104103
$addresses = array();
105104
foreach ($headers as $name => $value) {
106105
if (in_array(mb_strtolower($name), $addr_headers, true)) {
107-
foreach (Hm_Address_Field::parse($value) as $vals) {
108-
if (!$existing->search(array('email_address' => $vals['email']))) {
109-
$addresses[] = $vals;
106+
$values = is_array($value) ? $value : array($value);
107+
foreach ($values as $val) {
108+
foreach (Hm_Address_Field::parse($val) as $v) {
109+
if (!$existing->search(array('email_address' => $v['email']))) {
110+
$addresses[] = $v;
111+
}
110112
}
111113
}
112114
}
@@ -391,7 +393,7 @@ protected function output() {
391393
'<i class="bi bi-person-fill"></i> '.
392394
'</d><td>'.$this->html_safe($c->value('type')).'<td><span class="contact_src">'.
393395
($c->value('source') == 'local' ? '' : $this->html_safe($c->value('source'))).'</span>'.
394-
'</td><td>' . $this->html_safe($name) . '</td>' .
396+
'</td><td class="contact_name_fld" data-title="' . $this->html_safe($name) . '">' . $this->html_safe($name) . '</td>' .
395397
'<td><div class="contact_fld">'.$this->html_safe($c->value('email_address')).'</div></td>'.
396398
'<td class="contact_fld"><a href="tel:'.$this->html_safe($c->value('phone_number')).'">'.
397399
$this->html_safe($c->value('phone_number')).'</a></td>'.
@@ -411,8 +413,7 @@ protected function output() {
411413
$edit_url = Hm_LDAP_Contact::addDNToUrl($c, $edit_url);
412414
}
413415

414-
$res .= '<a '.$delete_attrs.' class="delete_contact cursor-pointer" title="'.$this->trans('Delete').'"><i class="bi bi-trash3 text-danger ms-2"></i></a>'.
415-
'<a href="'.$edit_url.'" class="edit_contact cursor-pointer" title="'.$this->trans('Edit').'"><i class="bi bi-pencil-square ms-2"></i></a>';
416+
$res .= '<a href="'.$edit_url.'" class="edit_contact cursor-pointer" title="'.$this->trans('Edit').'"><i class="bi bi-gear ms-2"></i></a>';
416417
}
417418

418419
$send_to_url = '?page=compose&amp;contact_id='.$this->html_safe($c->value('id')).
@@ -424,7 +425,11 @@ protected function output() {
424425
}
425426

426427
$res .= '<a href="'.$send_to_url.'" class="send_to_contact cursor-pointer" title="'.$this->trans('Send To').'">'.
427-
'<i class="bi bi-envelope-arrow-up ms-2"></i></a>';
428+
'<i class="bi bi-file-earmark-text ms-2"></i></a>';
429+
430+
if (in_array($c->value('type').':'.$c->value('source'), $editable, true)) {
431+
$res .= '<a '.$delete_attrs.' class="delete_contact cursor-pointer ms-3" title="'.$this->trans('Delete').'"><i class="bi bi-trash3 text-danger"></i></a>';
432+
}
428433

429434
$res .= '</td></tr>';
430435
$res .= '<tr><td id="contact_'.$this->html_safe($c->value('id')).'_detail" class="contact_detail_row" colspan="6">';

modules/contacts/site.css

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102

103103
@media (max-width: 767px) {
104104
.add_contact_responsive {
105-
width: 100%;
106-
margin: 10px 0;
105+
width: 95vw;
106+
margin: 10px;
107107
}
108108
}
109109

@@ -152,6 +152,13 @@
152152
text-overflow: ellipsis;
153153
}
154154

155+
.contact_name_fld {
156+
max-width: 200px;
157+
overflow: hidden;
158+
text-overflow: ellipsis;
159+
white-space: nowrap;
160+
}
161+
155162
#contact_csv {
156163
width: 80%;
157164
}
@@ -161,9 +168,8 @@
161168
}
162169

163170
.mobile .contact_list {
164-
margin-left: 0px;
165-
font-size: 125%;
166-
width: 100%;
171+
width: 95vw;
172+
margin: auto;
167173
}
168174

169175
.mobile .contact_controls img {
@@ -180,6 +186,10 @@
180186
display: none;
181187
}
182188

189+
.mobile .contact_name_fld {
190+
max-width: 120px;
191+
}
192+
183193
.contact_src {
184194
display: none;
185195
}

modules/contacts/site.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,4 @@ var check_cc_exist_in_contacts_list = function() {
264264
}
265265
return "";
266266
};
267+

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 is_imap_archive_folder($id, $user_config, $current_folder);
637+
}
638+
return false;
639+
}
640+
634641
public function get_config() {
635642
return $this->config;
636643
}

modules/core/js_modules/Hm_MessagesStore.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,27 @@ class Hm_MessagesStore {
116116
if (messagesReadyCB) {
117117
messagesReadyCB(this);
118118
}
119+
120+
responses.forEach(response => {
121+
response.resolvePromise(response);
122+
});
119123
};
120124

121125
await Promise.all(this.fetch(hideLoadingState).map((req) => {
122-
return req.then((response) => {
123-
pendingResponses.set(response.sourceId, response);
126+
return new Promise((resolve) => {
127+
req.then((response) => {
128+
response.resolvePromise = resolve;
129+
pendingResponses.set(response.sourceId, response);
124130

125-
if (processingTimeout) {
126-
clearTimeout(processingTimeout);
127-
}
131+
if (processingTimeout) {
132+
clearTimeout(processingTimeout);
133+
}
128134

129-
// Process after a short delay to allow batching
130-
processingTimeout = setTimeout(processPendingResponses, 10);
131-
}, (error) => {
132-
console.error('Error loading messages from source:', error);
135+
// Process after a short delay to allow batching
136+
processingTimeout = setTimeout(processPendingResponses, 10);
137+
}, (error) => {
138+
console.error('Error loading messages from source:', error);
139+
});
133140
});
134141
}));
135142

0 commit comments

Comments
 (0)