use Friendica\Util\Strings;
use Friendica\Util\XML;
-require_once 'include/conversation.php';
require_once 'mod/share.php';
require_once 'mod/item.php';
require_once 'mod/wall_upload.php';
*/
function api_error($type, $e)
{
- $a = get_app();
+ $a = \get_app();
$error = ($e->getMessage() !== "" ? $e->getMessage() : $e->httpdesc);
/// @TODO: https://dev.twitter.com/overview/api/response-codes
$contact = DBA::selectFirst('contact', [], ['uid' => 0, 'nurl' => Strings::normaliseLink($url)]);
if (DBA::isResult($contact)) {
- $network_name = ContactSelector::networkToName($contact['network'], $contact['url']);
-
// If no nick where given, extract it from the address
if (($contact['nick'] == "") || ($contact['name'] == $contact['nick'])) {
$contact['nick'] = api_get_nick($contact["url"]);
'id_str' => (string) $contact["id"],
'name' => $contact["name"],
'screen_name' => (($contact['nick']) ? $contact['nick'] : $contact['name']),
- 'location' => ($contact["location"] != "") ? $contact["location"] : $network_name,
+ 'location' => ($contact["location"] != "") ? $contact["location"] : ContactSelector::networkToName($contact['network'], $contact['url']),
'description' => $contact["about"],
'profile_image_url' => $contact["micro"],
'profile_image_url_https' => $contact["micro"],
$uinfo[0]['nick'] = api_get_nick($uinfo[0]["url"]);
}
- $network_name = ContactSelector::networkToName($uinfo[0]['network'], $uinfo[0]['url']);
-
$pcontact_id = Contact::getIdForURL($uinfo[0]['url'], 0, true);
if (!empty($profile['about'])) {
} elseif (!empty($uinfo[0]["location"])) {
$location = $uinfo[0]["location"];
} else {
- $location = $network_name;
+ $location = ContactSelector::networkToName($uinfo[0]['network'], $uinfo[0]['url']);
}
$ret = [
function api_account_verify_credentials($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_statuses_mediap($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
Logger::log('api_statuses_update: no user');
*/
function api_statuses_update($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
Logger::log('api_statuses_update: no user');
*/
function api_media_upload()
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
Logger::log('no user');
*/
function api_status_show($type, $item_id = 0)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
*/
function api_users_show($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
*/
function api_users_search($type)
{
- $a = get_app();
+ $a = \get_app();
$userlist = [];
*/
function api_search($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_home_timeline($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_public_timeline($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_networkpublic_timeline($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_show($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_conversation_show($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
{
global $called_api;
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_statuses_destroy($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_statuses_mentions($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_user_timeline($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_favorites_create_destroy($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
{
global $called_api;
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_format_items_activities($item, $type = "json")
{
- $a = get_app();
+ $a = \get_app();
$activities = [
'like' => [],
*/
function api_format_items($r, $user_info, $filter_user = false, $type = "json")
{
- $a = get_app();
+ $a = \get_app();
$ret = [];
*/
function api_lists_ownerships($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_lists_statuses($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_statuses_f($qtype)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_statusnet_config($type)
{
- $a = get_app();
+ $a = \get_app();
$name = Config::get('config', 'sitename');
$server = $a->getHostName();
throw new ForbiddenException();
}
- $a = get_app();
+ $a = \get_app();
api_get_user($a);
*/
function api_direct_messages_new($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_direct_messages_destroy($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_direct_messages_box($type, $box, $verbose)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
}
Contact::updateSelfFromUserID(api_user(), true);
// Update global directory in background
- $url = System::baseUrl() . '/profile/' . get_app()->user['nickname'];
+ $url = System::baseUrl() . '/profile/' . \get_app()->user['nickname'];
if ($url && strlen(Config::get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $url);
}
*/
function prepare_photo_data($type, $scale, $photo_id)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if ($user_info === false) {
}
$reshared_item["body"] = $shared_body;
+ $reshared_item["author-id"] = Contact::getIdForURL($profile, 0, true);
$reshared_item["author-name"] = $author;
$reshared_item["author-link"] = $profile;
$reshared_item["author-avatar"] = $avatar;
*/
function api_friendica_group_show($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_group_delete($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_lists_destroy($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_group_create($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_lists_create($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_group_update($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_lists_update($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_activity($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_notification($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_notification_seen($type)
{
- $a = get_app();
+ $a = \get_app();
$user_info = api_get_user($a);
if (api_user() === false || $user_info === false) {
*/
function api_friendica_direct_messages_setseen($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
}
*/
function api_friendica_direct_messages_search($type, $box = "")
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();
*/
function api_friendica_profile_show($type)
{
- $a = get_app();
+ $a = \get_app();
if (api_user() === false) {
throw new ForbiddenException();