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-30 11:49:36 +0300
committerJoas Schilling <coding@schilljs.com>2018-07-31 17:47:43 +0300
commit36ae3a3e5561c9ac27c5c8827d5815776997fa3a (patch)
tree19e094330084ab7786c08d0e96b5fb107d124e51 /lib/Manager.php
parentfe64e046aa3a9fa297e3a142ec9fa7beb64f86bc (diff)
Highlight the unread count only for mentions
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Manager.php')
-rw-r--r--lib/Manager.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/Manager.php b/lib/Manager.php
index f9a46b1e2..c15491b5e 100644
--- a/lib/Manager.php
+++ b/lib/Manager.php
@@ -96,7 +96,13 @@ class Manager {
$lastMessage = null;
if (!empty($row['comment_id'])) {
- $lastMessage = $this->commentsManager->getCommentFromData(array_merge($row, ['id' => $row['comment_id']]));
+ $lastMessage = $this->commentsManager->getCommentFromData(array_merge($row, [
+ 'id' => $row['comment_id'],
+ 'parent_id' => '',
+ 'topmost_parent_id' => '',
+ 'latest_child_timestamp' => null,
+ 'children_count' => 0,
+ ]));
}
return new Room($this, $this->db, $this->secureRandom, $this->dispatcher, $this->hasher, (int) $row['id'], (int) $row['type'], $row['token'], $row['name'], $row['password'], (int) $row['active_guests'], $activeSince, $lastActivity, $lastMessage);
@@ -108,7 +114,12 @@ class Manager {
* @return Participant
*/
public function createParticipantObject(Room $room, array $row) {
- return new Participant($this->db, $room, $row['user_id'], (int) $row['participant_type'], (int) $row['last_ping'], $row['session_id'], (bool) $row['in_call'], (bool) $row['favorite']);
+ $lastMention = null;
+ if (!empty($row['last_mention'])) {
+ $lastMention = new \DateTime($row['last_mention']);
+ }
+
+ return new Participant($this->db, $room, $row['user_id'], (int) $row['participant_type'], (int) $row['last_ping'], $row['session_id'], (bool) $row['in_call'], (bool) $row['favorite'], $lastMention);
}
/**