Remove /display/{nick}/{id} URL structure publishing
- Remove support for defunct Friendica F-Droid app
This commit is contained in:
parent
5b1fe458d9
commit
e6bf97777f
7 changed files with 13 additions and 126 deletions
|
@ -26,18 +26,6 @@ function notify_init(App $a)
|
|||
$note = $nm->getByID($a->argv[2]);
|
||||
if ($note) {
|
||||
$nm->setSeen($note);
|
||||
|
||||
// The friendica client has problems with the GUID. this is some workaround
|
||||
if ($a->isFriendicaApp()) {
|
||||
require_once("include/items.php");
|
||||
$urldata = parse_url($note['link']);
|
||||
$guid = basename($urldata["path"]);
|
||||
$itemdata = Item::getIdAndNickByGuid($guid, local_user());
|
||||
if ($itemdata["id"] != 0) {
|
||||
$note['link'] = System::baseUrl().'/display/'.$itemdata["nick"].'/'.$itemdata["id"];
|
||||
}
|
||||
}
|
||||
|
||||
System::externalRedirect($note['link']);
|
||||
}
|
||||
|
||||
|
|
|
@ -313,14 +313,7 @@ function ping_init(App $a)
|
|||
usort($notifs, $sort_function);
|
||||
|
||||
if (DBA::isResult($notifs)) {
|
||||
// Are the nofications called from the regular process or via the friendica app?
|
||||
$regularnotifications = (!empty($_GET['uid']) && !empty($_GET['_']));
|
||||
|
||||
foreach ($notifs as $notif) {
|
||||
if ($a->isFriendicaApp() || !$regularnotifications) {
|
||||
$notif['message'] = str_replace("{0}", $notif['name'], $notif['message']);
|
||||
}
|
||||
|
||||
$contact = Contact::getDetailsByURL($notif['url']);
|
||||
if (isset($contact['micro'])) {
|
||||
$notif['photo'] = ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO);
|
||||
|
|
|
@ -87,7 +87,7 @@ function subthread_content(App $a) {
|
|||
|
||||
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
|
||||
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
|
||||
$link = XML::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n");
|
||||
$link = XML::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $item['guid'] . '" />' . "\n");
|
||||
$body = $item['body'];
|
||||
|
||||
$obj = <<< EOT
|
||||
|
@ -128,7 +128,7 @@ EOT;
|
|||
|
||||
$ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
|
||||
$alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
|
||||
$plink = '[url=' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
|
||||
$plink = '[url=' . System::baseUrl() . '/display/' . $item['guid'] . ']' . $post_type . '[/url]';
|
||||
$arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink );
|
||||
|
||||
$arr['verb'] = $activity;
|
||||
|
|
|
@ -40,14 +40,12 @@ function tagger_content(App $a) {
|
|||
}
|
||||
|
||||
$owner_uid = $item['uid'];
|
||||
$owner_nick = '';
|
||||
$blocktags = 0;
|
||||
|
||||
$r = q("select `nickname`,`blocktags` from user where uid = %d limit 1",
|
||||
$r = q("select `blocktags` from user where uid = %d limit 1",
|
||||
intval($owner_uid)
|
||||
);
|
||||
if (DBA::isResult($r)) {
|
||||
$owner_nick = $r[0]['nickname'];
|
||||
$blocktags = $r[0]['blocktags'];
|
||||
}
|
||||
|
||||
|
@ -69,12 +67,7 @@ function tagger_content(App $a) {
|
|||
$xterm = XML::escape($term);
|
||||
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
|
||||
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
|
||||
|
||||
if ($owner_nick) {
|
||||
$href = System::baseUrl() . '/display/' . $owner_nick . '/' . $item['id'];
|
||||
} else {
|
||||
$href = System::baseUrl() . '/display/' . $item['guid'];
|
||||
}
|
||||
$href = System::baseUrl() . '/display/' . $item['guid'];
|
||||
|
||||
$link = XML::escape('<link rel="alternate" type="text/html" href="'. $href . '" />' . "\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue