How do i set, when i create a thread, that the message is read by the creator of the thread?
I have this portion of code
$composer = $this->get('fos_message.composer');
$message = $composer->newThread()
->setSender($this->getUser())
->setSubject('myThread')
->setBody($request->get('createThread')['my_thread']);
$sender = $this->get('fos_message.sender');
$sender->send($message);
But when i send the message in the last line, in the database the value of is_read is set to 0, when the sender should be set to 1. So, i need to set the author to is read when he send the message.
Anyone? :)