]> git.mxchange.org Git - friendica.git/blobdiff - include/post_update.php
Merge pull request #4246 from zeroadam/Widget-#3878
[friendica.git] / include / post_update.php
index 1d27f339968cc356ea0562d8bdcee6097089df83..fd72d888e5b6604a31596380fc2f8428b103e50e 100644 (file)
@@ -5,6 +5,8 @@
 
 use Friendica\Core\Config;
 use Friendica\Database\DBM;
+use Friendica\Model\Contact;
+use Friendica\Model\GContact;
 
 /**
  * @brief Calls the post update functions
@@ -72,7 +74,7 @@ function post_update_1192() {
 
        // Set the "gcontact-id" in the item table and add a new gcontact entry if needed
        foreach ($item_arr AS $item) {
-               $gcontact_id = get_gcontact_id(array("url" => $item['author-link'], "network" => $item['network'],
+               $gcontact_id = GContact::getId(array("url" => $item['author-link'], "network" => $item['network'],
                                                "photo" => $item['author-avatar'], "name" => $item['author-name']));
                q("UPDATE `item` SET `gcontact-id` = %d WHERE `uid` = %d AND `author-link` = '%s' AND `gcontact-id` = 0",
                        intval($gcontact_id), intval($item["uid"]), dbesc($item["author-link"]));
@@ -142,7 +144,7 @@ function post_update_1194() {
 
        logger("Progress: Start: ".$start_id." position: ".$pos_id." end: ".$end_id, LOGGER_DEBUG);
 
-       $r = q("UPDATE `item` ".$query2." SET `item`.`global` = 1 ".$query3,
+       q("UPDATE `item` ".$query2." SET `item`.`global` = 1 ".$query3,
                intval($start_id), intval($pos_id),
                dbesc(NETWORK_DFRN), dbesc(NETWORK_DIASPORA), dbesc(NETWORK_OSTATUS));
 
@@ -208,8 +210,8 @@ function post_update_1198() {
 
        // Set the "gcontact-id" in the item table and add a new gcontact entry if needed
        foreach ($item_arr AS $item) {
-               $author_id = get_contact($item["author-link"], 0);
-               $owner_id = get_contact($item["owner-link"], 0);
+               $author_id = Contact::getIdForURL($item["author-link"], 0);
+               $owner_id = Contact::getIdForURL($item["owner-link"], 0);
 
                if ($author_id == 0)
                        $author_id = -1;