Change called method names
- Add GlobalContact::getRandomUrl - Rename Contact::getIdForURL - Rename Diaspora::sendUnshare - Remove unused parameter $self in Contact::terminateFriendship
This commit is contained in:
parent
b92fc24ff0
commit
ec02af593d
48 changed files with 133 additions and 133 deletions
|
@ -692,7 +692,7 @@ function acl_lookup(App $a, $out_type = 'json') {
|
|||
);
|
||||
if (DBM::is_result($r)) {
|
||||
foreach ($r as $row) {
|
||||
$contact = get_contact_details_by_url($row['author-link']);
|
||||
$contact = Contact::getDetailsByURL($row['author-link']);
|
||||
|
||||
if (count($contact) > 0) {
|
||||
$unknown_contacts[] = array(
|
||||
|
|
|
@ -650,7 +650,7 @@ function api_get_user(App $a, $contact_id = null, $type = "json")
|
|||
'notifications' => false,
|
||||
'statusnet_profile_url' => $r[0]["url"],
|
||||
'uid' => 0,
|
||||
'cid' => get_contact($r[0]["url"], api_user(), true),
|
||||
'cid' => Contact::getIdForURL($r[0]["url"], api_user(), true),
|
||||
'self' => 0,
|
||||
'network' => $r[0]["network"],
|
||||
);
|
||||
|
@ -738,7 +738,7 @@ function api_get_user(App $a, $contact_id = null, $type = "json")
|
|||
|
||||
$network_name = network_to_name($uinfo[0]['network'], $uinfo[0]['url']);
|
||||
|
||||
$pcontact_id = get_contact($uinfo[0]['url'], 0, true);
|
||||
$pcontact_id = Contact::getIdForURL($uinfo[0]['url'], 0, true);
|
||||
|
||||
$ret = array(
|
||||
'id' => intval($pcontact_id),
|
||||
|
|
|
@ -24,7 +24,7 @@ function diaspora_mention2bb($match) {
|
|||
return;
|
||||
}
|
||||
|
||||
$data = get_contact_details_by_addr($match[2]);
|
||||
$data = Contact::getDetailsByAddr($match[2]);
|
||||
|
||||
$name = $match[1];
|
||||
|
||||
|
@ -97,7 +97,7 @@ function diaspora2bb($s) {
|
|||
*/
|
||||
function diaspora_mentions($match) {
|
||||
|
||||
$contact = get_contact_details_by_url($match[3]);
|
||||
$contact = Contact::getDetailsByURL($match[3]);
|
||||
|
||||
if (!x($contact, 'addr')) {
|
||||
$contact = Probe::uri($match[3]);
|
||||
|
|
|
@ -493,9 +493,9 @@ function bb_ShareAttributes($share, $simplehtml) {
|
|||
// We only call this so that a previously unknown contact can be added.
|
||||
// This is important for the function "get_contact_details_by_url".
|
||||
// This function then can fetch an entry from the contact table.
|
||||
get_contact($profile, 0);
|
||||
Contact::getIdForURL($profile, 0);
|
||||
|
||||
$data = get_contact_details_by_url($profile);
|
||||
$data = Contact::getDetailsByURL($profile);
|
||||
|
||||
if (isset($data["name"]) && ($data["name"] != "") && isset($data["addr"]) && ($data["addr"] != ""))
|
||||
$userid_compact = $data["name"]." (".$data["addr"].")";
|
||||
|
|
|
@ -734,7 +734,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
|
|||
}
|
||||
|
||||
if (!x($item, 'author-thumb') || ($item['author-thumb'] == "")) {
|
||||
$author_contact = get_contact_details_by_url($item['author-link'], $profile_owner);
|
||||
$author_contact = Contact::getDetailsByURL($item['author-link'], $profile_owner);
|
||||
if ($author_contact["thumb"]) {
|
||||
$item['author-thumb'] = $author_contact["thumb"];
|
||||
} else {
|
||||
|
@ -743,7 +743,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
|
|||
}
|
||||
|
||||
if (!isset($item['owner-thumb']) || ($item['owner-thumb'] == "")) {
|
||||
$owner_contact = get_contact_details_by_url($item['owner-link'], $profile_owner);
|
||||
$owner_contact = Contact::getDetailsByURL($item['owner-link'], $profile_owner);
|
||||
if ($owner_contact["thumb"]) {
|
||||
$item['owner-thumb'] = $owner_contact["thumb"];
|
||||
} else {
|
||||
|
|
|
@ -346,7 +346,7 @@ function profile_sidebar($profile, $block = 0)
|
|||
}
|
||||
|
||||
// Fetch the account type
|
||||
$account_type = account_type($profile);
|
||||
$account_type = Contact::getAccountType($profile);
|
||||
|
||||
if ((x($profile, 'address') == 1)
|
||||
|| (x($profile, 'location') == 1)
|
||||
|
|
|
@ -719,12 +719,12 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
|
|||
* This is done only for comments (See below explanation at "gcontact-id")
|
||||
*/
|
||||
if ($arr['parent-uri'] != $arr['uri']) {
|
||||
$arr["contact-id"] = get_contact($arr['author-link'], $uid);
|
||||
$arr["contact-id"] = Contact::getIdForURL($arr['author-link'], $uid);
|
||||
}
|
||||
|
||||
// If not present then maybe the owner was found
|
||||
if ($arr["contact-id"] == 0) {
|
||||
$arr["contact-id"] = get_contact($arr['owner-link'], $uid);
|
||||
$arr["contact-id"] = Contact::getIdForURL($arr['owner-link'], $uid);
|
||||
}
|
||||
|
||||
// Still missing? Then use the "self" contact of the current user
|
||||
|
@ -755,19 +755,19 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
|
|||
}
|
||||
|
||||
if ($arr["author-id"] == 0) {
|
||||
$arr["author-id"] = get_contact($arr["author-link"], 0);
|
||||
$arr["author-id"] = Contact::getIdForURL($arr["author-link"], 0);
|
||||
}
|
||||
|
||||
if (blockedContact($arr["author-id"])) {
|
||||
if (Contact::isBlocked($arr["author-id"])) {
|
||||
logger('Contact '.$arr["author-id"].' is blocked, item '.$arr["uri"].' will not be stored');
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($arr["owner-id"] == 0) {
|
||||
$arr["owner-id"] = get_contact($arr["owner-link"], 0);
|
||||
$arr["owner-id"] = Contact::getIdForURL($arr["owner-link"], 0);
|
||||
}
|
||||
|
||||
if (blockedContact($arr["owner-id"])) {
|
||||
if (Contact::isBlocked($arr["owner-id"])) {
|
||||
logger('Contact '.$arr["owner-id"].' is blocked, item '.$arr["uri"].' will not be stored');
|
||||
return 0;
|
||||
}
|
||||
|
@ -1751,7 +1751,7 @@ function lose_follower($importer, $contact, array $datarray = array(), $item = "
|
|||
if (($contact['rel'] == CONTACT_IS_FRIEND) || ($contact['rel'] == CONTACT_IS_SHARING)) {
|
||||
dba::update('contact', array('rel' => CONTACT_IS_SHARING), array('id' => $contact['id']));
|
||||
} else {
|
||||
contact_remove($contact['id']);
|
||||
Contact::remove($contact['id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1760,7 +1760,7 @@ function lose_sharer($importer, $contact, array $datarray = array(), $item = "")
|
|||
if (($contact['rel'] == CONTACT_IS_FRIEND) || ($contact['rel'] == CONTACT_IS_FOLLOWER)) {
|
||||
dba::update('contact', array('rel' => CONTACT_IS_FOLLOWER), array('id' => $contact['id']));
|
||||
} else {
|
||||
contact_remove($contact['id']);
|
||||
Contact::remove($contact['id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ function do_like($item_id, $verb) {
|
|||
$item_contact_id = $owner_self_contact['id'];
|
||||
$item_contact = $owner_self_contact;
|
||||
} else {
|
||||
$item_contact_id = get_contact($author_contact['url'], $item['uid']);
|
||||
$item_contact_id = Contact::getIdForURL($author_contact['url'], $item['uid']);
|
||||
|
||||
$contacts = q("SELECT * FROM `contact` WHERE `id` = %d",
|
||||
intval($item_contact_id)
|
||||
|
|
|
@ -210,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;
|
||||
|
|
|
@ -59,7 +59,7 @@ function add_shadow_thread($itemid) {
|
|||
}
|
||||
|
||||
// Is the public contact configured as hidden?
|
||||
if (hiddenContact($item["owner-id"]) || hiddenContact($item["author-id"])) {
|
||||
if (Contact::isHidden($item["owner-id"]) || Contact::isHidden($item["author-id"])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ function add_shadow_thread($itemid) {
|
|||
$item[0]['uid'] = 0;
|
||||
$item[0]['origin'] = 0;
|
||||
$item[0]['wall'] = 0;
|
||||
$item[0]['contact-id'] = get_contact($item[0]['author-link'], 0);
|
||||
$item[0]['contact-id'] = Contact::getIdForURL($item[0]['author-link'], 0);
|
||||
|
||||
if (in_array($item[0]['type'], array("net-comment", "wall-comment"))) {
|
||||
$item[0]['type'] = 'remote-comment';
|
||||
|
@ -165,7 +165,7 @@ function add_shadow_entry($itemid) {
|
|||
$item['uid'] = 0;
|
||||
$item['origin'] = 0;
|
||||
$item['wall'] = 0;
|
||||
$item['contact-id'] = get_contact($item['author-link'], 0);
|
||||
$item['contact-id'] = Contact::getIdForURL($item['author-link'], 0);
|
||||
|
||||
if (in_array($item['type'], array("net-comment", "wall-comment"))) {
|
||||
$item['type'] = 'remote-comment';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue