]> git.mxchange.org Git - friendica.git/blobdiff - include/message.php
Throw NotFoundException if results are empty in api_users_lookup
[friendica.git] / include / message.php
index 731a56c4c2a0d4e305aef88e598d390a1e7c836f..e49647b6ef7c9868fe162a28a31298a6e180711c 100644 (file)
@@ -5,6 +5,7 @@
 use Friendica\App;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
+use Friendica\Database\DBM;
 
 function send_message($recipient=0, $body='', $subject='', $replyto=''){
 
@@ -42,7 +43,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
                        dbesc($replyto),
                        dbesc($replyto)
                );
-               if (dbm::is_result($r))
+               if (DBM::is_result($r))
                        $convid = $r[0]['convid'];
        }
 
@@ -67,7 +68,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
                $r = dba::insert('conv', $fields);
 
                $r = dba::select('conv', array('id'), array('guid' => $conv_guid, 'uid' => local_user()), array('limit' => 1));
-               if (dbm::is_result($r))
+               if (DBM::is_result($r))
                        $convid = $r['id'];
        }
 
@@ -106,7 +107,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
                dbesc($uri),
                intval(local_user())
        );
-       if (dbm::is_result($r))
+       if (DBM::is_result($r))
                $post_id = $r[0]['id'];
 
        /**
@@ -144,7 +145,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
        }
 
        if ($post_id) {
-               Worker::add(PRIORITY_HIGH, "notifier", "mail", $post_id);
+               Worker::add(PRIORITY_HIGH, "Notifier", "mail", $post_id);
                return intval($post_id);
        } else {
                return -3;
@@ -168,9 +169,7 @@ function send_wallmessage($recipient='', $body='', $subject='', $replyto=''){
        $convid = 0;
        $reply = false;
 
-       require_once 'include/probe.php';
-
-       $me = probe_url($replyto);
+       $me = Probe::uri($replyto);
 
        if (! $me['name']) {
                return -2;
@@ -193,7 +192,7 @@ function send_wallmessage($recipient='', $body='', $subject='', $replyto=''){
        $r = dba::insert('conv', $fields);
 
        $r = dba::select('conv', array('id'), array('guid' => $conv_guid, 'uid' => $recipient['uid']), array('limit' => 1));
-       if (!dbm::is_result($r)) {
+       if (!DBM::is_result($r)) {
                logger('send message: conversation not found.');
                return -4;
        }