kopia lustrzana https://github.com/nextcloud/social
forward type of action
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>pull/799/head
rodzic
163fa57a3c
commit
221ae0f121
|
|
@ -141,10 +141,10 @@ class OStatusController extends Controller {
|
|||
}
|
||||
|
||||
try {
|
||||
$post = $this->streamService->getStreamById($uri, true, true);
|
||||
$this->streamService->getStreamById($uri, true, true);
|
||||
|
||||
$link = $this->urlGenerator->linkToRouteAbsolute('social.SocialPub.displayRemotePost')
|
||||
. '?id=' . $uri;
|
||||
. '?id=' . $uri . '&type=' . $this->parseRefererType();
|
||||
|
||||
return new RedirectResponse($link);
|
||||
} catch (Exception $e) {
|
||||
|
|
@ -243,5 +243,34 @@ class OStatusController extends Controller {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private function parseRefererType(): string {
|
||||
$referer = $this->request->getHeader('Referer');
|
||||
$params = explode('&', parse_url($referer, PHP_URL_QUERY));
|
||||
$type = '';
|
||||
foreach ($params as $param) {
|
||||
list($key, $value) = explode('=', $param);
|
||||
if ($key === 'type') {
|
||||
$type = $value;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'reblog':
|
||||
return 'boost';
|
||||
|
||||
case 'favourite':
|
||||
return 'like';
|
||||
|
||||
case 'reply':
|
||||
return 'reply';
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -241,8 +241,6 @@ class StreamRequest extends StreamRequestBuilder {
|
|||
};
|
||||
|
||||
$qb = $this->getStreamSelectSql();
|
||||
$expr = $qb->expr();
|
||||
|
||||
$qb->limitToIdPrim($qb->prim($id));
|
||||
$qb->linkToCacheActors('ca', 's.attributed_to_prim');
|
||||
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue