use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Widget;
-use Friendica\Core\ACL;
use Friendica\Core\Hook;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
}
// @TODO: Replace with parameter from router
- if ($a->argv[1] === 'batch') {
+ if (DI::args()->getArgv()[1] === 'batch') {
self::batchActions();
return;
}
// @TODO: Replace with parameter from router
- $contact_id = intval($a->argv[1]);
+ $contact_id = intval(DI::args()->getArgv()[1]);
if (!$contact_id) {
return;
}
}
if ($contact['network'] == Protocol::OSTATUS) {
- $user = Model\User::getById($contact['uid']);
- $result = Model\Contact::createFromProbe($user, $contact['url'], false, $contact['network']);
+ $result = Model\Contact::createFromProbeForUser($contact['uid'], $contact['url'], $contact['network']);
if ($result['success']) {
DBA::update('contact', ['subhub' => 1], ['id' => $contact_id]);
$contact = null;
// @TODO: Replace with parameter from router
- if ($a->argc == 2 && intval($a->argv[1])
- || $a->argc == 3 && intval($a->argv[1]) && in_array($a->argv[2], ['posts', 'conversations'])
+ if (DI::args()->getArgc() == 2 && intval(DI::args()->getArgv()[1])
+ || DI::args()->getArgc() == 3 && intval(DI::args()->getArgv()[1]) && in_array(DI::args()->getArgv()[2], ['posts', 'conversations'])
) {
- $contact_id = intval($a->argv[1]);
+ $contact_id = intval(DI::args()->getArgv()[1]);
// Ensure to use the user contact when the public contact was provided
$data = Model\Contact::getPublicAndUserContactID($contact_id, local_user());
if (DBA::isResult($contact)) {
if ($contact['self']) {
// @TODO: Replace with parameter from router
- if (($a->argc == 3) && intval($a->argv[1]) && in_array($a->argv[2], ['posts', 'conversations'])) {
+ if ((DI::args()->getArgc() == 3) && intval(DI::args()->getArgv()[1]) && in_array(DI::args()->getArgv()[2], ['posts', 'conversations'])) {
DI::baseUrl()->redirect('profile/' . $contact['nick']);
} else {
DI::baseUrl()->redirect('profile/' . $contact['nick'] . '/profile');
return Login::form();
}
- if ($a->argc == 3) {
- $contact_id = intval($a->argv[1]);
+ if (DI::args()->getArgc() == 3) {
+ $contact_id = intval(DI::args()->getArgv()[1]);
if (!$contact_id) {
throw new BadRequestException();
}
// @TODO: Replace with parameter from router
- $cmd = $a->argv[2];
+ $cmd = DI::args()->getArgv()[2];
$orig_record = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => [0, local_user()], 'self' => false, 'deleted' => false]);
if (!DBA::isResult($orig_record)) {
'$location_label' => DI::l10n()->t('Location:'),
'$xmpp' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['xmpp']),
'$xmpp_label' => DI::l10n()->t('XMPP:'),
+ '$matrix' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['matrix']),
+ '$matrix_label' => DI::l10n()->t('Matrix:'),
'$about' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['about'], BBCode::EXTERNAL),
'$about_label' => DI::l10n()->t('About:'),
'$keywords' => $contact['keywords'],
$sql_values = [local_user()];
// @TODO: Replace with parameter from router
- $type = $a->argv[1] ?? '';
+ $type = DI::args()->getArgv()[1] ?? '';
switch ($type) {
case 'blocked':
if (!$update) {
// We need the editor here to be able to reshare an item.
if (local_user()) {
- $x = [
- 'is_owner' => true,
- 'allow_location' => $a->user['allow_location'],
- 'default_location' => $a->user['default-location'],
- 'nickname' => $a->user['nickname'],
- 'lockstate' => (is_array($a->user) && (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'),
- 'acl' => ACL::getFullSelectorHTML(DI::page(), $a->user, true),
- 'bang' => '',
- 'visitor' => 'block',
- 'profile_uid' => local_user(),
- ];
- $o = status_editor($a, $x, 0, true);
+ $o = status_editor($a, [], 0, true);
}
}