GlobalContact created

Moved DirSearch and GlobalContact related functions to Friendica\Model namespace
This commit is contained in:
Adam Magness 2017-11-15 09:47:28 -05:00
commit 47db624105
26 changed files with 2715 additions and 2610 deletions

View file

@ -4,6 +4,7 @@ use Friendica\App;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\GlobalContact;
use Friendica\Network\Probe;
require_once 'include/Contact.php';
@ -312,7 +313,7 @@ function _contact_update_profile($contact_id) {
update_contact_avatar($data['photo'], local_user(), $contact_id, true);
// Update the entry in the gcontact table
update_gcontact_from_probe($data["url"]);
GlobalContact::updateFromProbe($data["url"]);
}
function _contact_block($contact_id, $orig_record) {
@ -561,12 +562,12 @@ function contacts_content(App $a) {
$nettype = sprintf( t('Network type: %s'),network_to_name($contact['network'], $contact["url"]));
//$common = count_common_friends(local_user(),$contact['id']);
//$common = GlobalContact::countCommonFriends(local_user(),$contact['id']);
//$common_text = (($common) ? sprintf( tt('%d contact in common','%d contacts in common', $common),$common) : '');
$polling = (($contact['network'] === NETWORK_MAIL | $contact['network'] === NETWORK_FEED) ? 'polling' : '');
//$x = count_all_friends(local_user(), $contact['id']);
//$x = GlobalContact::countAllFriends(local_user(), $contact['id']);
//$all_friends = (($x) ? t('View all contacts') : '');
// tabs
@ -878,7 +879,7 @@ function contacts_tab($a, $contact_id, $active_tab) {
);
// Show this tab only if there is visible friend list
$x = count_all_friends(local_user(), $contact_id);
$x = GlobalContact::countAllFriends(local_user(), $contact_id);
if ($x)
$tabs[] = array('label'=>t('Contacts'),
'url' => "allfriends/".$contact_id,
@ -888,7 +889,7 @@ function contacts_tab($a, $contact_id, $active_tab) {
'accesskey' => 't');
// Show this tab only if there is visible common friend list
$common = count_common_friends(local_user(),$contact_id);
$common = GlobalContact::countCommonFriends(local_user(), $contact_id);
if ($common)
$tabs[] = array('label'=>t('Common Friends'),
'url' => "common/loc/".local_user()."/".$contact_id,