Skip to content
Open
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
9 changes: 7 additions & 2 deletions modules/github/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,9 @@ protected function output() {
if (!$this->get('hide_folder_icons')) {
$res .= '<i class="bi bi-code-slash account_icon"></i> ';
}
$res .= $this->html_safe(explode('/', urldecode($repo))[1]).'</a></li>';
$repo_parts = explode('/', urldecode($repo));
$repo_display_name = isset($repo_parts[1]) ? $repo_parts[1] : $repo;
$res .= $this->html_safe($repo_display_name).'</a></li>';
}
$this->append('folder_sources', array('github_folders', $res));
}
Expand All @@ -452,8 +454,11 @@ protected function output() {
}
$repo_id = $this->get('github_data_source_id');
$repo = $this->get('github_data_source', 'Github');
if (empty($this->get('github_data')) || $repo === 'Github') {
return;
}
$repo_parts = explode('/', $repo);
$repo_name = $repo_parts[1];
$repo_name = isset($repo_parts[1]) ? $repo_parts[1] : 'Github';
$cutoff = $this->get('github_list_since', '');
if ($cutoff) {
$cutoff = strtotime($cutoff);
Expand Down
7 changes: 7 additions & 0 deletions modules/imap/handler_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,10 @@ public function process() {
$folders = array_map(function($ds) { return $ds['folder']; }, $data_sources);
}

if (empty($ids)) {
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method outputs some data which other modules expect to use. If you return early, that output data will not be available. What is the problem of ids being empty? The code that follows should just work and output some empty/default data.

}

list($sort, $reverse) = process_sort_arg($this->request->get['sort'], $this->user_config->get('default_sort_order_setting', 'arrival'));

if (isset($this->request->post['list_path'])) {
Expand Down Expand Up @@ -1363,6 +1367,9 @@ public function process() {
foreach ($ids as $key => $id) {
$details = Hm_IMAP_List::dump($id);
$mailbox = Hm_IMAP_List::get_connected_mailbox($id, $this->cache);
if (!$mailbox) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like we are masking a deeper problem. Why would the mailbox be not present? If there is a problem connecting or something else, we should send feedback to the user, at least.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like we are masking a deeper problem. Why would the mailbox be not present? If there is a problem connecting or something else, we should send feedback to the user, at least.

Let me investigate more deeper about this !

continue;
}
if($this->get('list_path') == 'snoozed' && !$mailbox->folder_exists('Snoozed')) {
continue;
}
Expand Down
Loading