Skip to content

Commit

Permalink
Fix: When replying to a message, the conversation is marked as unread (
Browse files Browse the repository at this point in the history
…#415)

* Fix: When replying to a message, the conversation is marked as unread

* Add PR ID to Changelog
  • Loading branch information
marc-farre authored Aug 17, 2024
1 parent edfcf04 commit 026a109
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changelog
- Enh #411: Standardization of Modal Button Positions
- Enh #363: Deny access for files from message where current user is not participant
- Fix #412: Fix active message after mark unread
- Fix #15: When replying to a message, the conversation is marked as unread

3.2.2 (July 9, 2024)
--------------------
Expand Down
8 changes: 8 additions & 0 deletions models/forms/ReplyForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ public function save()
$this->reply->refresh(); // Update created_by date, otherwise db expression is set...
$this->reply->notify();
$this->reply->fileManager->attach(Yii::$app->request->post('fileList'));

// Update last viewed date to avoid marking the conversation as unread
$userMessage = $this->model->getUserMessage($this->reply->user_id);
if ($userMessage) {
$userMessage->last_viewed = date('Y-m-d G:i:s');
$userMessage->save();
}

return true;
}

Expand Down

0 comments on commit 026a109

Please sign in to comment.