MDL-64034 core_message: return conversationid in search_messages()
[moodle.git] / message / classes / output / messagearea / contact.php
index 3a138c1..364940c 100644 (file)
@@ -108,6 +108,11 @@ class contact implements templatable, renderable {
      */
     public $unreadcount;
 
+    /**
+     * @var int The id of the conversation to which to message belongs.
+     */
+    public $conversationid;
+
     /**
      * Constructor.
      *
@@ -127,6 +132,7 @@ class contact implements templatable, renderable {
         $this->isblocked = $contact->isblocked;
         $this->isread = $contact->isread;
         $this->unreadcount = $contact->unreadcount;
+        $this->conversationid = $contact->conversationid ?? null;
     }
 
     public function export_for_template(\renderer_base $output) {
@@ -152,6 +158,7 @@ class contact implements templatable, renderable {
         $contact->isblocked = $this->isblocked;
         $contact->isread = $this->isread;
         $contact->unreadcount = $this->unreadcount;
+        $contact->conversationid = $this->conversationid;
 
         return $contact;
     }