]> git.mxchange.org Git - friendica.git/blobdiff - include/message.php
Split the name in the hcard
[friendica.git] / include / message.php
index 59146214164f92c92094eacc22bf563308e436dd..e49647b6ef7c9868fe162a28a31298a6e180711c 100644 (file)
@@ -4,6 +4,8 @@
 
 use Friendica\App;
 use Friendica\Core\System;
+use Friendica\Core\Worker;
+use Friendica\Database\DBM;
 
 function send_message($recipient=0, $body='', $subject='', $replyto=''){
 
@@ -41,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'];
        }
 
@@ -65,8 +67,8 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
                                'subject' => $subject, 'recips' => $handles);
                $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))
+               $r = dba::select('conv', array('id'), array('guid' => $conv_guid, 'uid' => local_user()), array('limit' => 1));
+               if (DBM::is_result($r))
                        $convid = $r['id'];
        }
 
@@ -105,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'];
 
        /**
@@ -143,7 +145,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){
        }
 
        if ($post_id) {
-               proc_run(PRIORITY_HIGH, "include/notifier.php", "mail", $post_id);
+               Worker::add(PRIORITY_HIGH, "Notifier", "mail", $post_id);
                return intval($post_id);
        } else {
                return -3;
@@ -167,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;
@@ -191,8 +191,8 @@ function send_wallmessage($recipient='', $body='', $subject='', $replyto=''){
                        'subject' => $subject, 'recips' => $handles);
        $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)) {
+       $r = dba::select('conv', array('id'), array('guid' => $conv_guid, 'uid' => $recipient['uid']), array('limit' => 1));
+       if (!DBM::is_result($r)) {
                logger('send message: conversation not found.');
                return -4;
        }