public function addMessage(MessageInterface $message)
 {
     parent::addMessage($message);
     $this->sortDenormalizedProperties();
 }
 /**
  * Ensures that metadata exists for each thread participant and that the
  * last message dates are current
  *
  * @param Thread $thread
  */
 protected function doEnsureThreadMetadataExists(Thread $thread)
 {
     foreach ($thread->getParticipants() as $participant) {
         if (!($meta = $thread->getMetadataForParticipant($participant))) {
             $meta = $this->createThreadMetadata();
             $meta->setParticipant($participant);
             $thread->addMetadata($meta);
         }
     }
 }