1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-21 21:30:08 +00:00

Use ->getControllerLink() in favor of ->getLink()

This commit is contained in:
Tim Düsterhus 2022-03-04 19:43:44 +01:00
parent 527a04db58
commit 8bf595d583
Signed by: TimWolla
GPG Key ID: 8FF75566094168AF
5 changed files with 13 additions and 15 deletions

View File

@ -16,6 +16,7 @@
namespace chat\data\message;
use chat\data\room\Room;
use chat\page\LogPage;
use wcf\data\DatabaseObjectDecorator;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
@ -41,10 +42,9 @@ public function __construct(Message $message, Room $room)
*/
public function jsonSerialize()
{
$link = LinkHandler::getInstance()->getLink(
'Log',
$link = LinkHandler::getInstance()->getControllerLink(
LogPage::class,
[
'application' => 'chat',
'messageid' => $this->messageID,
'object' => $this->room,
]

View File

@ -15,6 +15,7 @@
namespace chat\data\room;
use chat\page\RoomPage;
use chat\system\cache\runtime\UserRuntimeCache as ChatUserRuntimeCache;
use chat\system\permission\PermissionHandler;
use wcf\data\DatabaseObject;
@ -281,10 +282,9 @@ public function getUsers()
*/
public function getLink(): string
{
return LinkHandler::getInstance()->getLink(
'Room',
return LinkHandler::getInstance()->getControllerLink(
RoomPage::class,
[
'application' => 'chat',
'object' => $this,
'forceFrontend' => true,
]

View File

@ -155,11 +155,10 @@ public function readData()
foreach ($objects as $message) {
if ($message->getMessageType()->getProcessor()->canSeeInLog($message, $this->room)) {
$parameters = [
'application' => 'chat',
'messageid' => $message->messageID,
'object' => $this->room,
];
HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Log', $parameters));
HeaderUtil::redirect(LinkHandler::getInstance()->getControllerLink(self::class, $parameters));
exit;
}
@ -173,7 +172,7 @@ public function readData()
'messageid' => $minimum,
'object' => $this->room,
];
HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Log', $parameters));
HeaderUtil::redirect(LinkHandler::getInstance()->getControllerLink(self::class, $parameters));
exit;
}

View File

@ -17,6 +17,7 @@
use chat\data\room\Room;
use chat\data\room\RoomList;
use chat\page\RoomListPage;
use chat\page\RoomPage;
use wcf\system\box\AbstractDatabaseObjectListBoxController;
use wcf\system\request\LinkHandler;
@ -92,9 +93,7 @@ public function hasLink()
*/
public function getLink()
{
return LinkHandler::getInstance()->getLink('RoomList', [
'application' => 'chat',
]);
return LinkHandler::getInstance()->getControllerLink(RoomListPage::class);
}
/**

View File

@ -16,6 +16,7 @@
namespace chat\system\page\handler;
use chat\data\room\RoomCache;
use chat\page\LogPage;
use wcf\data\page\Page;
use wcf\data\user\online\UserOnline;
use wcf\system\page\handler\AbstractLookupPageHandler;
@ -42,10 +43,9 @@ public function getLink($objectID): string
throw new \InvalidArgumentException('Invalid room ID given');
}
return LinkHandler::getInstance()->getLink(
'Log',
return LinkHandler::getInstance()->getControllerLink(
LogPage::class,
[
'application' => 'chat',
'object' => $room,
]
);