]> git.mxchange.org Git - friendica.git/blobdiff - include/enotify.php
Merge pull request #3902 from annando/worker-space
[friendica.git] / include / enotify.php
index 10723fb418af41432d91f80d3a8da7f7f8320d03..7de2027ca8342fafd5e84f3cf791b336f7939603 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 
 use Friendica\App;
+use Friendica\Core\Config;
 use Friendica\Core\System;
+use Friendica\Database\DBM;
 
 require_once('include/Emailer.php');
 require_once('include/email.php');
@@ -51,7 +53,7 @@ function notification($params) {
                        array('uid' => $params['uid']), array('limit' => 1));
 
                // There is no need to create notifications for forum accounts
-               if (!dbm::is_result($user) || in_array($user["page-flags"], array(PAGE_COMMUNITY, PAGE_PRVGROUP))) {
+               if (!DBM::is_result($user) || in_array($user["page-flags"], array(PAGE_COMMUNITY, PAGE_PRVGROUP))) {
                        return;
                }
        }
@@ -422,7 +424,7 @@ function notification($params) {
                        $hash = random_string();
                        $r = q("SELECT `id` FROM `notify` WHERE `hash` = '%s' LIMIT 1",
                                dbesc($hash));
-                       if (dbm::is_result($r)) {
+                       if (DBM::is_result($r)) {
                                $dups = true;
                        }
                } while ($dups == true);
@@ -589,7 +591,7 @@ function notification($params) {
 
                // check whether sending post content in email notifications is allowed
                // always true for SYSTEM_EMAIL
-               $content_allowed = ((!get_config('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL));
+               $content_allowed = ((!Config::get('system', 'enotify_no_content')) || ($params['type'] == SYSTEM_EMAIL));
 
                // load the template for private message notifications
                $tpl = get_markup_template('email_notify_html.tpl');
@@ -742,17 +744,17 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
                        intval($item[0]['contact-id']),
                        intval($uid)
                );
-               $send_notification = dbm::is_result($r);
+               $send_notification = DBM::is_result($r);
 
                if (!$send_notification) {
                        $tags = q("SELECT `url` FROM `term` WHERE `otype` = %d AND `oid` = %d AND `type` = %d AND `uid` = %d",
                                intval(TERM_OBJ_POST), intval($itemid), intval(TERM_MENTION), intval($uid));
 
-                       if (dbm::is_result($tags)) {
+                       if (DBM::is_result($tags)) {
                                foreach ($tags AS $tag) {
                                        $r = q("SELECT `id` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d AND `notify_new_posts`",
                                                normalise_link($tag["url"]), intval($uid));
-                                       if (dbm::is_result($r))
+                                       if (DBM::is_result($r))
                                                $send_notification = true;
                                }
                        }