diff options
author | Joas Schilling <coding@schilljs.com> | 2019-07-17 17:45:57 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-07-17 17:45:57 +0300 |
commit | a0d5a835a95e66a426887f5dc8c5ca3c27a83b3f (patch) | |
tree | 6b36c77e422b9486ac3e0916c5247e4ae689c01b /lib/Manager.php | |
parent | 9702156de88aeb2817e7664ee7d66e545ec0eccf (diff) |
Add a new column to record who joined a call
This makes sure users that only joined the chat are not listed in the call summary
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Manager.php')
-rw-r--r-- | lib/Manager.php | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/lib/Manager.php b/lib/Manager.php index 473482225..de9ce758e 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -126,7 +126,26 @@ class Manager { ])); } - return new Room($this, $this->db, $this->secureRandom, $this->dispatcher, $this->timeFactory, $this->hasher, (int) $row['id'], (int) $row['type'], (int) $row['read_only'], $row['token'], $row['name'], $row['password'], (int) $row['active_guests'], $activeSince, $lastActivity, $lastMessage, (string) $row['object_type'], (string) $row['object_id']); + return new Room( + $this, + $this->db, + $this->secureRandom, + $this->dispatcher, + $this->timeFactory, + $this->hasher, + (int) $row['id'], + (int) $row['type'], + (int) $row['read_only'], + $row['token'], + $row['name'], + $row['password'], + (int) $row['active_guests'], + $activeSince, + $lastActivity, + $lastMessage, + (string) $row['object_type'], + (string) $row['object_id'] + ); } /** @@ -140,7 +159,24 @@ class Manager { $lastMention = $this->timeFactory->getDateTime($row['last_mention']); } - return new Participant($this->db, $room, (string) $row['user_id'], (int) $row['participant_type'], (int) $row['last_ping'], (string) $row['session_id'], (int) $row['in_call'], (int) $row['notification_level'], (bool) $row['favorite'], $lastMention); + $lastJoinedCall = null; + if (!empty($row['last_joined_call'])) { + $lastJoinedCall = $this->timeFactory->getDateTime($row['last_joined_call']); + } + + return new Participant( + $this->db, + $room, + (string) $row['user_id'], + (int) $row['participant_type'], + (int) $row['last_ping'], + (string) $row['session_id'], + (int) $row['in_call'], + (int) $row['notification_level'], + (bool) $row['favorite'], + $lastMention, + $lastJoinedCall + ); } /** |