]> git.mxchange.org Git - friendica-addons.git/commitdiff
Apply suggestions from code review
authorMichael Vogel <icarus@dabo.de>
Sun, 3 Oct 2021 19:58:05 +0000 (21:58 +0200)
committerGitHub <noreply@github.com>
Sun, 3 Oct 2021 19:58:05 +0000 (21:58 +0200)
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
mailstream/mailstream.php

index d2e174103946673f3cc8243a1bf9f3f910466a79..8c7d213c49f24df2186da74a0708560cd76e9bfa 100644 (file)
@@ -439,10 +439,9 @@ function mailstream_html_wrap(&$text)
  */
 function mailstream_convert_table_entries()
 {
-       $ms_item_ids = DBA::selectToArray('mailstream_item', ['message-id', 'uri', 'uid', 'contact-id'], ["`mailstream_item`.`completed` IS NULL"]);
-       if (DBA::isResult($ms_item_ids)) {
-               Logger::debug('mailstream_convert_table_entries processing ' . count($ms_item_ids) . ' items');
-               foreach ($ms_item_ids as $ms_item_id) {
+       $ms_item_ids = DBA::selectToArray('mailstream_item', [], ['message-id', 'uri', 'uid', 'contact-id'], ["`mailstream_item`.`completed` IS NULL"]);
+       Logger::debug('mailstream_convert_table_entries processing ' . count($ms_item_ids) . ' items');
+       foreach ($ms_item_ids as $ms_item_id) {
                        $send_hook_data = array('uid' => $ms_item_id['uid'],
                                                'contact-id' => $ms_item_id['contact-id'],
                                                'uri' => $ms_item_id['uri'],
@@ -454,8 +453,7 @@ function mailstream_convert_table_entries()
                                                                continue;
                        }
                        Logger::info('mailstream_convert_table_entries: convert item to workerqueue', $send_hook_data);
-                       Hook::fork(PRIORITY_LOW, 'mailstream_send_hook', $send_hook_data);
-               }
+               Hook::fork(PRIORITY_LOW, 'mailstream_send_hook', $send_hook_data);
        }
        DBA::e('DROP TABLE `mailstream_item`');
 }