Skip to content

Commit

Permalink
Workaround some incorrect data types (cypht-org#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
mercihabam authored Nov 20, 2024
1 parent 3515e9a commit b5b97f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion modules/imap/handler_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,11 @@ public function process() {
}
$folders = array($folder);
} else {
$data_sources = imap_data_sources('', $this->session->get('custom_imap_sources', user:true));
$userCustomSources = $this->session->get('custom_imap_sources', user:true);
if (! $userCustomSources) {
$userCustomSources = [];
}
$data_sources = imap_data_sources('', $userCustomSources);
$ids = array_map(function($ds) { return $ds['id']; }, $data_sources);
$folders = array_map(function($ds) { return $ds['folder']; }, $data_sources);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/imap/hm-imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ public function get_message_list($uids, $raw=false, $include_preview = false) {
$lines = explode("\r\n", $vals[$i]);
foreach ($lines as $line) {
$header = mb_strtolower(mb_substr($line, 0, mb_strpos($line, ':')));
if (!$header || (!isset($flds[$header]) && $last_header)) {
if ($last_header && (!$header || !isset($flds[$header]))) {
${$flds[$last_header]} .= str_replace("\t", " ", $line);
}
elseif (isset($flds[$header])) {
Expand Down
2 changes: 1 addition & 1 deletion modules/imap/js_modules/route_handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function applyImapMessageListPageHandlers(routeParams) {
}

function applyImapMessageContentPageHandlers(routeParams) {
imap_setup_message_view_page(routeParams.uid, null, routeParams.list_path, handleExternalResources);
imap_setup_message_view_page(routeParams.uid, null, routeParams.list_path);
imap_setup_snooze();
imap_setup_tags();

Expand Down
2 changes: 1 addition & 1 deletion modules/imap/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ var imap_message_view_finished = function(msg_uid, detail, skip_links) {
});
fixLtrInRtl();

handleExternalResources();
handleAttachementDownload();
handleViewMessagePart();
};
Expand All @@ -764,7 +765,6 @@ var imap_setup_message_view_page = function(uid, details, list_path, callback) {
}
const callbackFn = (...args) => {
markPrefetchedMessagesAsRead(uid);
observeMessageTextMutationAndHandleExternalResources();
if (callback) {
callback(...args);
}
Expand Down

0 comments on commit b5b97f5

Please sign in to comment.