]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Remove unused upubkey and uprvkey from queries
[friendica.git] / mod / item.php
index 9a725bae440a6d8905d87bc78c668588cc0f9bfe..4aafa22995667e083bb1f92abd4628280ad26865 100644 (file)
@@ -22,7 +22,9 @@ use Friendica\Core\Worker;
 use Friendica\Database\DBM;
 use Friendica\Model\GlobalContact;
 use Friendica\Network\Probe;
+use Friendica\Object\Contact;
 use Friendica\Protocol\Diaspora;
+use Friendica\Util\Emailer;
 
 require_once 'include/crypto.php';
 require_once 'include/enotify.php';
@@ -32,7 +34,6 @@ require_once 'include/files.php';
 require_once 'include/threads.php';
 require_once 'include/text.php';
 require_once 'include/items.php';
-require_once 'include/Contact.php';
 
 function item_post(App $a) {
 
@@ -146,7 +147,7 @@ function item_post(App $a) {
                        $thrparent = q("SELECT `author-link`, `network` FROM `item` WHERE `uri` = '%s' LIMIT 1", dbesc($thr_parent));
                        if (DBM::is_result($thrparent) && ($thrparent[0]["network"] === NETWORK_OSTATUS)
                                && (normalise_link($parent_contact["url"]) != normalise_link($thrparent[0]["author-link"]))) {
-                               $parent_contact = get_contact_details_by_url($thrparent[0]["author-link"]);
+                               $parent_contact = Contact::getDetailsByURL($thrparent[0]["author-link"]);
 
                                if (!isset($parent_contact["nick"])) {
                                        $probed_contact = Probe::uri($thrparent[0]["author-link"]);
@@ -703,11 +704,11 @@ function item_post(App $a) {
        $datarray['owner-name']    = $contact_record['name'];
        $datarray['owner-link']    = $contact_record['url'];
        $datarray['owner-avatar']  = $contact_record['thumb'];
-       $datarray['owner-id']      = get_contact($datarray['owner-link'], 0);
+       $datarray['owner-id']      = Contact::getIdForURL($datarray['owner-link'], 0);
        $datarray['author-name']   = $author['name'];
        $datarray['author-link']   = $author['url'];
        $datarray['author-avatar'] = $author['thumb'];
-       $datarray['author-id']     = get_contact($datarray['author-link'], 0);
+       $datarray['author-id']     = Contact::getIdForURL($datarray['author-link'], 0);
        $datarray['created']       = datetime_convert();
        $datarray['edited']        = datetime_convert();
        $datarray['commented']     = datetime_convert();
@@ -834,7 +835,7 @@ function item_post(App $a) {
                // update filetags in pconfig
                file_tag_update_pconfig($uid,$categories_old,$categories_new,'category');
 
-               Worker::add(PRIORITY_HIGH, "notifier", 'edit_post', $post_id);
+               Worker::add(PRIORITY_HIGH, "Notifier", 'edit_post', $post_id);
                if ((x($_REQUEST, 'return')) && strlen($return_path)) {
                        logger('return: ' . $return_path);
                        goaway($return_path);
@@ -984,7 +985,7 @@ function item_post(App $a) {
 
 
                // Store the comment signature information in case we need to relay to Diaspora
-               Diaspora::store_comment_signature($datarray, $author, ($self ? $user['prvkey'] : false), $post_id);
+               Diaspora::storeCommentSignature($datarray, $author, ($self ? $user['prvkey'] : false), $post_id);
 
        } else {
                $parent = $post_id;
@@ -1036,13 +1037,13 @@ function item_post(App $a) {
                                $message = '<html><body>' . $link . $html . $disclaimer . '</body></html>';
                                include_once 'include/html2plain.php';
                                $params = array (
-                                   'fromName' => $a->user['username'],
-                                   'fromEmail' => $a->user['email'],
-                                   'toEmail' => $addr,
-                                   'replyTo' => $a->user['email'],
-                                   'messageSubject' => $subject,
-                                   'htmlVersion' => $message,
-                                   'textVersion' => html2plain($html.$disclaimer),
+                                       'fromName' => $a->user['username'],
+                                       'fromEmail' => $a->user['email'],
+                                       'toEmail' => $addr,
+                                       'replyTo' => $a->user['email'],
+                                       'messageSubject' => $subject,
+                                       'htmlVersion' => $message,
+                                       'textVersion' => html2plain($html.$disclaimer)
                                );
                                Emailer::send($params);
                        }
@@ -1064,10 +1065,10 @@ function item_post(App $a) {
        // We now do it in the background to save some time.
        // This is important in interactive environments like the frontend or the API.
        // We don't fork a new process since this is done anyway with the following command
-       Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "create_shadowentry", $post_id);
+       Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "CreateShadowEntry", $post_id);
 
        // Call the background process that is delivering the item to the receivers
-       Worker::add(PRIORITY_HIGH, "notifier", $notify_type, $post_id);
+       Worker::add(PRIORITY_HIGH, "Notifier", $notify_type, $post_id);
 
        logger('post_complete');
 
@@ -1133,9 +1134,8 @@ function item_content(App $a) {
  *
  * @return boolean true if replaced, false if not replaced
  */
-function handle_tag(App $a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "") {
-       require_once 'include/socgraph.php';
-
+function handle_tag(App $a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $network = "")
+{
        $replaced = false;
        $r = null;
        $tag_type = '@';