How to set when I create a stream so that the message is read by the stream creator?
I have this piece 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 on the last line, the database value is_read is set to 0, when the sender should be set to 1. Thus, I need to configure the author to read when he sends the message.
Anyone? :)
source share