Includes and calls

Remove includes and update function calls
This commit is contained in:
Adam Magness 2018-01-09 09:59:52 -05:00
parent edfb08a779
commit a59ab5552e
9 changed files with 25 additions and 24 deletions

View File

@ -14,7 +14,6 @@ use Friendica\Network\Probe;
require_once 'include/contact_selectors.php'; require_once 'include/contact_selectors.php';
require_once 'include/contact_widgets.php'; require_once 'include/contact_widgets.php';
require_once 'include/follow.php';
require_once 'mod/proxy.php'; require_once 'mod/proxy.php';
function contacts_init(App $a) function contacts_init(App $a)
@ -243,7 +242,7 @@ function _contact_update($contact_id)
$uid = $contact["uid"]; $uid = $contact["uid"];
if ($r[0]["network"] == NETWORK_OSTATUS) { if ($r[0]["network"] == NETWORK_OSTATUS) {
$result = new_contact($uid, $contact["url"], false, $contact["network"]); $result = Contact::new($uid, $contact["url"], false, $contact["network"]);
if ($result['success']) { if ($result['success']) {
q("UPDATE `contact` SET `subhub` = 1 WHERE `id` = %d", intval($contact_id)); q("UPDATE `contact` SET `subhub` = 1 WHERE `id` = %d", intval($contact_id));
@ -275,7 +274,7 @@ function _contact_update_profile($contact_id)
$update = array(); $update = array();
if ($data["network"] == NETWORK_OSTATUS) { if ($data["network"] == NETWORK_OSTATUS) {
$result = new_contact($uid, $data["url"], false); $result = Contact::new($uid, $data["url"], false);
if ($result['success']) { if ($result['success']) {
$update["subhub"] = true; $update["subhub"] = true;

View File

@ -1,12 +1,13 @@
<?php <?php
/**
* @file mod/follow.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Network\Probe; use Friendica\Network\Probe;
require_once 'include/follow.php';
require_once 'include/contact_selectors.php'; require_once 'include/contact_selectors.php';
function follow_post(App $a) { function follow_post(App $a) {
@ -29,7 +30,7 @@ function follow_post(App $a) {
// This is just a precaution if maybe this page is called somewhere directly via POST // This is just a precaution if maybe this page is called somewhere directly via POST
$_SESSION["fastlane"] = $url; $_SESSION["fastlane"] = $url;
$result = new_contact($uid,$url,true); $result = Contact::new($uid, $url, true);
if ($result['success'] == false) { if ($result['success'] == false) {
if ($result['message']) { if ($result['message']) {

View File

@ -1,11 +1,11 @@
<?php <?php
/**
* @file mod/fsuggest.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBM; use Friendica\Database\DBM;
require_once 'include/follow.php';
function fsuggest_post(App $a) { function fsuggest_post(App $a) {
if (! local_user()) { if (! local_user()) {

View File

@ -1,12 +1,13 @@
<?php <?php
/**
* @file mod/ostatus_subscribe.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Model\Contact;
use Friendica\Network\Probe; use Friendica\Network\Probe;
require_once 'include/follow.php';
function ostatus_subscribe_content(App $a) { function ostatus_subscribe_content(App $a) {
if (! local_user()) { if (! local_user()) {
@ -67,7 +68,7 @@ function ostatus_subscribe_content(App $a) {
$data = Probe::uri($url); $data = Probe::uri($url);
if ($data["network"] == NETWORK_OSTATUS) { if ($data["network"] == NETWORK_OSTATUS) {
$result = new_contact($uid, $url, true, NETWORK_OSTATUS); $result = Contact::new($uid, $url, true, NETWORK_OSTATUS);
if ($result["success"]) { if ($result["success"]) {
$o .= " - ".t("success"); $o .= " - ".t("success");
} else { } else {

View File

@ -1,9 +1,10 @@
<?php <?php
/**
* @file mod/repair_ostatus.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Model\Contact;
require_once 'include/follow.php';
function repair_ostatus_content(App $a) { function repair_ostatus_content(App $a) {
@ -51,7 +52,7 @@ function repair_ostatus_content(App $a) {
$o .= "<p>".t("Keep this window open until done.")."</p>"; $o .= "<p>".t("Keep this window open until done.")."</p>";
$result = new_contact($uid,$r[0]["url"],true); $result = Contact::new($uid,$r[0]["url"],true);
$a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.System::baseUrl().'/repair_ostatus?counter='.$counter.'">'; $a->page['htmlhead'] = '<meta http-equiv="refresh" content="1; URL='.System::baseUrl().'/repair_ostatus?counter='.$counter.'">';

View File

@ -5,12 +5,12 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Protocol\OStatus; use Friendica\Protocol\OStatus;
use Friendica\Protocol\Salmon; use Friendica\Protocol\Salmon;
use Friendica\Util\Crypto; use Friendica\Util\Crypto;
require_once 'include/items.php'; require_once 'include/items.php';
require_once 'include/follow.php';
function salmon_return($val) { function salmon_return($val) {
@ -164,7 +164,7 @@ function salmon_post(App $a) {
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
logger('mod-salmon: Author unknown to us.'); logger('mod-salmon: Author unknown to us.');
if(PConfig::get($importer['uid'],'system','ostatus_autofriend')) { if(PConfig::get($importer['uid'],'system','ostatus_autofriend')) {
$result = new_contact($importer['uid'],$author_link); $result = Contact::new($importer['uid'], $author_link);
if($result['success']) { if($result['success']) {
$r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s') $r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s')
AND `uid` = %d LIMIT 1", AND `uid` = %d LIMIT 1",

View File

@ -1,11 +1,12 @@
<?php <?php
/**
* @file mod/unfollow.php
*/
use Friendica\App; use Friendica\App;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
require_once 'include/follow.php';
require_once 'include/contact_selectors.php'; require_once 'include/contact_selectors.php';
function unfollow_post(App $a) { function unfollow_post(App $a) {

View File

@ -26,7 +26,6 @@ require_once 'include/bbcode.php';
require_once 'include/items.php'; require_once 'include/items.php';
require_once 'mod/share.php'; require_once 'mod/share.php';
require_once 'include/enotify.php'; require_once 'include/enotify.php';
require_once 'include/follow.php';
require_once 'include/api.php'; require_once 'include/api.php';
require_once 'mod/proxy.php'; require_once 'mod/proxy.php';

View File

@ -13,7 +13,6 @@ use Friendica\Protocol\PortableContact;
use dba; use dba;
require_once 'include/dba.php'; require_once 'include/dba.php';
require_once 'include/follow.php';
Class OnePoll Class OnePoll
{ {
@ -118,7 +117,7 @@ Class OnePoll
return; return;
} }
if (!update_contact($contact["id"])) { if (!Contact::update($contact["id"])) {
Contact::markForArchival($contact); Contact::markForArchival($contact);
logger('Contact is marked dead'); logger('Contact is marked dead');