<?php
declare(strict_types=1);
/**
*
* @copyright Copyright (c) 2017, Daniel Calviño Sánchez (danxuliu@gmail.com)
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Talk\Controller;
use OCA\Talk\Chat\AutoComplete\SearchPlugin;
use OCA\Talk\Chat\AutoComplete\Sorter;
use OCA\Talk\Chat\ChatManager;
use OCA\Talk\Chat\MessageParser;
use OCA\Talk\GuestManager;
use OCA\Talk\MatterbridgeManager;
use OCA\Talk\Model\Attendee;
use OCA\Talk\Model\Message;
use OCA\Talk\Model\Session;
use OCA\Talk\Participant;
use OCA\Talk\Room;
use OCA\Talk\Service\ParticipantService;
use OCA\Talk\Service\SessionService;
use OCP\App\IAppManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Collaboration\AutoComplete\IManager;
use OCP\Collaboration\Collaborators\ISearchResult;
use OCP\Comments\IComment;
use OCP\Comments\MessageTooLongException;
use OCP\Comments\NotFoundException;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IL10N;
use OCP\IRequest;
use OCP\IUserManager;
use OCP\RichObjectStrings\InvalidObjectExeption;
use OCP\RichObjectStrings\IValidator;
use OCP\User\Events\UserLiveStatusEvent;
use OCP\UserStatus\IManager as IUserStatusManager;
use OCP\UserStatus\IUserStatus;
class ChatController extends AEnvironmentAwareController {
/** @var string */
private $userId;
/** @var IUserManager */
private $userManager;
/** @var IAppManager */
private $appManager;
/** @var ChatManager */
private $chatManager;
/** @var ParticipantService */
private $participantService;
/** @var SessionService */
private $sessionService;
/** @var GuestManager */
private $guestManager;
/** @var string[] */
protected $guestNames;
/** @var MessageParser */
private $messageParser;
/** @var IManager */
private $autoCompleteManager;
/** @var IUserStatusManager */
private $statusManager;
/** @var MatterbridgeManager */
protected $matterbridgeManager;
/** @var SearchPlugin */
private $searchPlugin;
/** @var ISearchResult */
private $searchResult;
/** @var ITimeFactory */
protected $timeFactory;
/** @var IEventDispatcher */
protected $eventDispatcher;
/** @var IValidator */
protected $richObjectValidator;
/** @var IL10N */
private $l;
public function __construct(string $appName,
?string $UserId,
IRequest $request,
IUserManager $userManager,
IAppManager $appManager,
ChatManager $chatManager,
ParticipantService $participantService,
SessionService $sessionService,
GuestManager $guestManager,
MessageParser $messageParser,
IManager $autoCompleteManager,
IUserStatusManager $statusManager,
MatterbridgeManager $matterbridgeManager,
SearchPlugin $searchPlugin,
ISearchResult $searchResult,
ITimeFactory $timeFactory