Skip to content

Commit

Permalink
Merge pull request #1208 from Shadow243/update-fixes-before-release
Browse files Browse the repository at this point in the history
Update fixes before release
  • Loading branch information
marclaporte authored Aug 29, 2024
2 parents c607012 + 1bd46f3 commit ef76d24
Show file tree
Hide file tree
Showing 32 changed files with 319 additions and 34 deletions.
1 change: 0 additions & 1 deletion .github/tests/selenium/creds.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
chrome_options.BinaryLocation = "/usr/bin/google-chrome"
chrome_options.add_argument("--window-size=3200,3800")

chrome_options.headless = False
chrome_options.add_argument("start-maximized")
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions language/az.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,4 +635,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,4 +650,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/es.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/et.php
Original file line number Diff line number Diff line change
Expand Up @@ -640,4 +640,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/fa.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,4 +684,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/fr.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,4 +631,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/hu.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/id.php
Original file line number Diff line number Diff line change
Expand Up @@ -639,4 +639,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/it.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/ja.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/nl.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/pt-BR.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,4 +631,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/ro.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,4 +631,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/ru.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
1 change: 1 addition & 0 deletions language/zh-Hans.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,4 +653,5 @@
'No tags available yet.' => false,
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
);
6 changes: 5 additions & 1 deletion lib/repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ public static function add($entity, $save = true) {

public static function edit($id, $entity) {
if (array_key_exists($id, self::$entities)) {
self::$entities[$id] = array_merge(self::$entities[$id], $entity);
if (is_array($entity)) {
self::$entities[$id] = array_merge(self::$entities[$id], $entity);
} else {
self::$entities[$id] = $entity;
}
self::save();
return true;
}
Expand Down
50 changes: 50 additions & 0 deletions modules/contacts/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,56 @@ protected function output() {
}
}

/**
* @subpackage contacts/handler
*/
class Hm_Handler_save_contact extends Hm_Handler_Module
{
public function process()
{
list($success, $form ) = $this->process_form(array('email_address'));
if ($success) {
$contacts = $this->get('contact_store');
$contact_list = $contacts->getAll();
$existingEmails = array_map(function($contact){
return $contact->value('email_address');
},$contact_list);

$list_mails = array_unique(explode(",", $form['email_address']));

foreach ($list_mails as $addr) {
$addresses = process_address_fld($addr);
$newEmails = array_column($addresses, 'email');
if (!empty($newEmails)) {
$newContacts = array_filter($newEmails, function ($email) use ($existingEmails) {
return !in_array($email, $existingEmails);
});
$existingContacts = array_filter($existingEmails, function ($email) use ($newEmails) {
return in_array($email, $newEmails);
});
if (!empty($newContacts)) {
$newContacts = array_map(function ($email) {
return ['source' => 'local', 'email_address' => $email, 'display_name' => $email, 'group' => 'Trusted Senders'];
}, $newContacts);
$contacts->add_contact($newContacts[0]);
}
if (!empty($existingContacts)) {
$existingContacts = array_map(function ($email) {
return ['source' => 'local', 'email_address' => $email, 'group' => 'Trusted Senders'];
}, $existingContacts);
foreach ($existingContacts as $key => $contact) {
$contacts->update_contact($key, $contact);
}
}
}
}
$this->session->record_unsaved('Contacts added to Trusted Contacts list');
Hm_Msgs::add('Contacts added to Trusted Contacts list');
}

}
}

/**
* @subpackage contacts/output
*/
Expand Down
7 changes: 5 additions & 2 deletions modules/contacts/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
add_handler('compose', 'load_contacts', true, 'contacts', 'process_compose_form_submit', 'after');
add_handler('compose', 'store_contact_message', true, 'contacts', 'load_contacts', 'after');

add_handler('ajax_imap_folder_display', 'load_contacts', true, 'contacts', 'load_user_data', 'after');

add_handler('ajax_imap_message_content', 'load_contacts', true, 'contacts', 'load_user_data', 'after');
add_handler('ajax_imap_message_content', 'find_message_contacts', true, 'contacts', 'imap_message_content', 'after');
add_output('ajax_imap_message_content', 'add_message_contacts', true, 'contacts', 'filter_message_headers', 'after');
Expand All @@ -31,6 +33,7 @@
setup_base_ajax_page('ajax_add_contact', 'core');
add_handler('ajax_add_contact', 'load_contacts', true, 'contacts', 'load_user_data', 'after');
add_handler('ajax_add_contact', 'save_user_data', true, 'core', 'language', 'after');
add_handler('ajax_add_contact', 'save_contact', true);


setup_base_ajax_page('ajax_autocomplete_contact', 'core');
Expand Down Expand Up @@ -81,8 +84,8 @@
'contact_source' => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
'contact_type' => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
'contact_auto_collect' => FILTER_VALIDATE_BOOLEAN,
'enable_warn_contacts_cc_not_exist_in_list_contact' => FILTER_VALIDATE_INT

'enable_warn_contacts_cc_not_exist_in_list_contact' => FILTER_VALIDATE_INT,
'email_address' => FILTER_SANITIZE_FULL_SPECIAL_CHARS
),
'allowed_get' => array(
'contact_id' => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
Expand Down
13 changes: 12 additions & 1 deletion modules/core/message_list_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,18 @@ function message_list_row($values, $id, $style, $output_mod, $row_class='') {
if ($row_class) {
$res .= ' '.$output_mod->html_safe($row_class);
}
$res .= '">';
$data_uid = "";
if ($uids = explode("_", $id)) {
if (isset($uids[2])) {
$data_uid = 'data-uid="'. $uids[2] .'"';
}
}
if (!empty($data_uid)) {
$res .= '" '.$data_uid.'>';
} else {
$res .= '">';
}

if ($style == 'news') {
$res .= '<td class="news_cell checkbox_cell">';
}
Expand Down
1 change: 1 addition & 0 deletions modules/core/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
'filter' => FILTER_DEFAULT,
'sort' => FILTER_DEFAULT,
'keyword' => FILTER_DEFAULT,
'screen_emails' => FILTER_DEFAULT,
),

'allowed_post' => array(
Expand Down
2 changes: 2 additions & 0 deletions modules/feeds/hm-feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class Hm_Feed {
var $init_cache;
var $cache_limit;
var $sort;
var $status_code;
var $feed_type;

/**
* Setup defaults
Expand Down
18 changes: 16 additions & 2 deletions modules/imap/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -857,19 +857,33 @@ function imap_refresh_oauth2_token($server, $config) {
* @return int count of messages moved
*/
if (!hm_exists('imap_move_same_server')) {
function imap_move_same_server($ids, $action, $hm_cache, $dest_path) {
function imap_move_same_server($ids, $action, $hm_cache, $dest_path, $screen_emails=false) {
$moved = array();
$keys = array_keys($ids);
$server_id = array_pop($keys);
$cache = Hm_IMAP_List::get_cache($hm_cache, $server_id);
$imap = Hm_IMAP_List::connect($server_id, $cache);
foreach ($ids[$server_id] as $folder => $msgs) {
if (imap_authed($imap) && $imap->select_mailbox(hex2bin($folder))) {
if ($imap->message_action(mb_strtoupper($action), $msgs, hex2bin($dest_path[2]))) {
if ($screen_emails) {
foreach ($msgs as $msg) {
$moved[] = sprintf('imap_%s_%s_%s', $server_id, $msg, $folder);
$email = current(array_column(process_address_fld($imap->get_message_headers($msg)['From']), "email"));
$uids = $imap->search('ALL', false, array(array('FROM', $email)));
foreach ($uids as $uid) {
if ($imap->message_action(mb_strtoupper($action), $uid, hex2bin($dest_path[2]))) {
$moved[] = sprintf('imap_%s_%s_%s', $server_id, $uid, $folder);
}
}
}
} else {
if ($imap->message_action(mb_strtoupper($action), $msgs, hex2bin($dest_path[2]))) {
foreach ($msgs as $msg) {
$moved[] = sprintf('imap_%s_%s_%s', $server_id, $msg, $folder);
}
}
}

}
}
return $moved;
Expand Down
Loading

0 comments on commit ef76d24

Please sign in to comment.