Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-07-23 14:05:56 +0300
committerJoas Schilling <coding@schilljs.com>2018-07-27 12:02:58 +0300
commitd7fcb6fb4a3f2882785333cbb317954b16dea3b1 (patch)
tree774a96acfd2e7de69814c61844679958b729a44a /lib/Activity
parentad7fa306031b6c5aecc71420a98b2ae4b9f86114 (diff)
Add calls to system messages
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Activity')
-rw-r--r--lib/Activity/Hooks.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/Activity/Hooks.php b/lib/Activity/Hooks.php
index 0de978578..d9385df91 100644
--- a/lib/Activity/Hooks.php
+++ b/lib/Activity/Hooks.php
@@ -22,6 +22,7 @@ declare(strict_types=1);
namespace OCA\Spreed\Activity;
+use OCA\Spreed\Chat\ChatManager;
use OCA\Spreed\Room;
use OCP\Activity\IManager;
use OCP\AppFramework\Utility\ITimeFactory;
@@ -37,15 +38,19 @@ class Hooks {
/** @var IUserSession */
protected $userSession;
+ /** @var ChatManager */
+ protected $chatManager;
+
/** @var ILogger */
protected $logger;
/** @var ITimeFactory */
protected $timeFactory;
- public function __construct(IManager $activityManager, IUserSession $userSession, ILogger $logger, ITimeFactory $timeFactory) {
+ public function __construct(IManager $activityManager, IUserSession $userSession, ChatManager $chatManager, ILogger $logger, ITimeFactory $timeFactory) {
$this->activityManager = $activityManager;
$this->userSession = $userSession;
+ $this->chatManager = $chatManager;
$this->logger = $logger;
$this->timeFactory = $timeFactory;
}
@@ -99,6 +104,15 @@ class Hooks {
return false;
}
+ $this->chatManager->addSystemMessage($room, 'users', $userIds[0], json_encode([
+ 'message' => 'call_ended',
+ 'parameters' => [
+ 'users' => $userIds,
+ 'guests' => $room->getActiveGuests(),
+ 'duration' => $duration,
+ ],
+ ]), new \DateTime());
+
foreach ($userIds as $userId) {
try {
$event->setAffectedUser($userId);