X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fenotify.php;h=99d5ea0ab3939504f7458cac9a919efe46e613a3;hb=b4cf27e76731556c2b4d2941f51b74e1935e0ba7;hp=62328c01fdfea5667aa84e9001d3075767bd6270;hpb=94f6f12ba3a5c1d506255803e709cb640147ebf4;p=friendica.git diff --git a/include/enotify.php b/include/enotify.php index 62328c01fd..99d5ea0ab3 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -1,12 +1,15 @@ $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))) { - return; + // 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))) { + return; + } } $nickname = $user["nickname"]; @@ -366,7 +371,7 @@ function notification($params) { } } - if ($params['type'] == "SYSTEM_EMAIL") { + if ($params['type'] == SYSTEM_EMAIL) { // not part of the notifications. // it just send a mail to the user. // It will be used by the system to send emails to users (like @@ -420,7 +425,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); @@ -517,7 +522,7 @@ function notification($params) { // send email notification if notification preferences permit if ((intval($params['notify_flags']) & intval($params['type'])) || $params['type'] == NOTIFY_SYSTEM - || $params['type'] == "SYSTEM_EMAIL") { + || $params['type'] == SYSTEM_EMAIL) { logger('sending notification email'); @@ -586,8 +591,8 @@ function notification($params) { call_hooks('enotify_mail', $datarray); // 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")); + // always true for 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'); @@ -633,7 +638,8 @@ function notification($params) { // use the Emailer class to send the message - return Emailer::send(array( + return Emailer::send( + array( 'uid' => $params['uid'], 'fromName' => $sender_name, 'fromEmail' => $sender_email, @@ -642,11 +648,11 @@ function notification($params) { 'messageSubject' => $datarray['subject'], 'htmlVersion' => $email_html_body, 'textVersion' => $email_text_body, - 'additionalMailHeader' => $datarray['headers'], - )); + 'additionalMailHeader' => $datarray['headers']) + ); } - return False; + return false; } /** @@ -740,17 +746,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; } }