]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
Add Contact Object
[friendica.git] / include / items.php
index 64aeabceab13206b1754cf4e4650084a2bd91716..63ecc791b4dfcde3dd06e227e27c40ae247c25a9 100644 (file)
@@ -5,14 +5,17 @@
  */
 
 use Friendica\App;
-use Friendica\Core\System;
 use Friendica\ParseUrl;
-use Friendica\Util\Lock;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\Worker;
+use Friendica\Core\System;
 use Friendica\Database\DBM;
+use Friendica\Model\GlobalContact;
+use Friendica\Object\Contact;
 use Friendica\Protocol\DFRN;
+use Friendica\Protocol\OStatus;
+use Friendica\Util\Lock;
 
 require_once 'include/bbcode.php';
 require_once 'include/oembed.php';
@@ -24,18 +27,13 @@ require_once 'include/files.php';
 require_once 'include/text.php';
 require_once 'include/email.php';
 require_once 'include/threads.php';
-require_once 'include/socgraph.php';
 require_once 'include/plaintext.php';
-require_once 'include/ostatus.php';
 require_once 'include/feed.php';
 require_once 'include/Contact.php';
 require_once 'mod/share.php';
 require_once 'include/enotify.php';
 require_once 'include/group.php';
 
-/// @TODO one day with composer autoloader no more needed
-require_once 'library/defuse/php-encryption-1.2.1/Crypto.php';
-
 function construct_verb($item) {
        if ($item['verb']) {
                return $item['verb'];
@@ -545,9 +543,9 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
        /// @todo Check if this is really still needed
        if ($arr['network'] == NETWORK_OSTATUS) {
                if (isset($arr['plink'])) {
-                       $arr['plink'] = ostatus::convert_href($arr['plink']);
+                       $arr['plink'] = OStatus::convertHref($arr['plink']);
                } elseif (isset($arr['uri'])) {
-                       $arr['plink'] = ostatus::convert_href($arr['uri']);
+                       $arr['plink'] = OStatus::convertHref($arr['uri']);
                }
        }
 
@@ -748,10 +746,10 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
                 * On comments the author is the better choice.
                 */
                if ($arr['parent-uri'] === $arr['uri']) {
-                       $arr["gcontact-id"] = get_gcontact_id(array("url" => $arr['owner-link'], "network" => $arr['network'],
+                       $arr["gcontact-id"] = GlobalContact::getId(array("url" => $arr['owner-link'], "network" => $arr['network'],
                                                                 "photo" => $arr['owner-avatar'], "name" => $arr['owner-name']));
                } else {
-                       $arr["gcontact-id"] = get_gcontact_id(array("url" => $arr['author-link'], "network" => $arr['network'],
+                       $arr["gcontact-id"] = GlobalContact::getId(array("url" => $arr['author-link'], "network" => $arr['network'],
                                                                 "photo" => $arr['author-avatar'], "name" => $arr['author-name']));
                }
        }
@@ -1141,7 +1139,7 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
        check_item_notification($current_post, $uid);
 
        if ($notify) {
-               Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "notifier", $notify_type, $current_post);
+               Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "Notifier", $notify_type, $current_post);
        }
 
        return $current_post;
@@ -1424,7 +1422,7 @@ function tag_deliver($uid, $item_id) {
        );
        update_thread($item_id);
 
-       Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), 'notifier', 'tgroup', $item_id);
+       Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), 'Notifier', 'tgroup', $item_id);
 
 }
 
@@ -1535,7 +1533,7 @@ function consume_feed($xml, $importer, &$contact, &$hub, $datedir = 0, $pass = 0
                        //$tempfile = tempnam(get_temppath(), "ostatus2");
                        //file_put_contents($tempfile, $xml);
                        logger("Consume OStatus messages ", LOGGER_DEBUG);
-                       ostatus::import($xml, $importer, $contact, $hub);
+                       OStatus::import($xml, $importer, $contact, $hub);
                }
                return;
        }
@@ -2058,7 +2056,7 @@ function item_expire($uid, $days, $network = "", $force = false) {
                drop_item($item['id'], false);
        }
 
-       Worker::add(array('priority' => PRIORITY_LOW, 'dont_fork' => true), "notifier", "expire", $uid);
+       Worker::add(array('priority' => PRIORITY_LOW, 'dont_fork' => true), "Notifier", "expire", $uid);
 }
 
 /// @TODO type-hint is array
@@ -2080,7 +2078,7 @@ function drop_items($items) {
        // multiple threads may have been deleted, send an expire notification
 
        if ($uid) {
-               Worker::add(array('priority' => PRIORITY_LOW, 'dont_fork' => true), "notifier", "expire", $uid);
+               Worker::add(array('priority' => PRIORITY_LOW, 'dont_fork' => true), "Notifier", "expire", $uid);
        }
 }
 
@@ -2272,7 +2270,7 @@ function drop_item($id, $interactive = true) {
                $drop_id = intval($item['id']);
                $priority = ($interactive ? PRIORITY_HIGH : PRIORITY_LOW);
 
-               Worker::add(array('priority' => $priority, 'dont_fork' => true), "notifier", "drop", $drop_id);
+               Worker::add(array('priority' => $priority, 'dont_fork' => true), "Notifier", "drop", $drop_id);
 
                if (! $interactive) {
                        return $owner;