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

View File

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

View File

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

View File

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

View File

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