]> git.mxchange.org Git - friendica-addons.git/commitdiff
More comprehensible check for root user contact
authorMatthew Exon <mat.github@exon.name>
Tue, 9 Jul 2024 19:13:00 +0000 (20:13 +0100)
committerMatthew Exon <git.mexon@spamgourmet.com>
Sun, 14 Jul 2024 16:50:56 +0000 (18:50 +0200)
mailstream/mailstream.php

index c5cf8f3fab123378fc6687e66b5a0d40eaef37b8..b86c4e2a314bd8a39b8aaa0fd23f3686e5d79741 100644 (file)
@@ -144,12 +144,12 @@ function mailstream_post_hook(array &$item)
 {
        mailstream_check_version();
 
-       if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) {
-               Logger::debug('mailstream not enabled.', ['item' => $item['id'], 'uid' => $item['uid']]);
+       if ($item['uid'] === 0) {
+               Logger::debug('mailstream: root user, skipping item ' . $item['id']);
                return;
        }
-       if (!$item['uid']) {
-               Logger::debug('no uid', ['item' => $item['id']]);
+       if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) {
+               Logger::debug('mailstream: not enabled.', ['item' => $item['id'], ' uid ' => $item['uid']]);
                return;
        }
        if (!$item['contact-id']) {