2 namespace wcf\system\page\handler
;
3 use wcf\data\page\Page
;
4 use wcf\data\user\online\UserOnline
;
5 use wcf\system\cache\runtime\UserConversationRuntimeCache
;
9 * Implementation of the online location-related page handler methods for conversations.
11 * @author Matthias Schmidt
12 * @copyright 2001-2016 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package com.woltlab.wcf.conversation
15 * @subpackage system.page.handler
16 * @category Community Framework
19 trait TConversationOnlineLocationPageHandler
{
20 use TOnlineLocationPageHandler
;
23 * @see IMenuPageHandler::getOnlineLocation()
25 public function getOnlineLocation(Page
$page, UserOnline
$user) {
26 if ($user->objectID
=== null) {
30 $conversation = UserConversationRuntimeCache
::getInstance()->getObject($user->objectID
);
31 if ($conversation === null ||
!$conversation->canRead()) {
35 return WCF
::getLanguage()->getDynamicVariable('wcf.page.onlineLocation.'.$page->identifier
, ['conversation' => $conversation]);
39 * @see IOnlineLocationPageHandler::prepareOnlineLocation()
41 public function prepareOnlineLocation(Page
$page, UserOnline
$user) {
42 if ($user->objectID
!== null) {
43 UserConversationRuntimeCache
::getInstance()->cacheObjectID($user->objectID
);