From 6daebeba6f7a2565bbf543de6df486ff332d583c Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Wed, 4 Jun 2014 13:43:29 -0500
Subject: [PATCH] Correctly generate ticket_link for message confirm

---
 include/class.thread.php | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/class.thread.php b/include/class.thread.php
index aa78f1acb..48f4d7922 100644
--- a/include/class.thread.php
+++ b/include/class.thread.php
@@ -414,8 +414,17 @@ Class ThreadEntry {
 
     function getUser() {
 
-        if (!isset($this->user))
-            $this->user = User::lookup($this->getUserId());
+        if (!isset($this->user)) {
+            if (!($ticket = $this->getTicket()))
+                return null;
+
+            if ($ticket->getOwnerId() == $ticket->getUserId())
+                $this->user = new TicketOwner(
+                    User::lookup($this->getUserId()), $ticket);
+            else
+                $this->user = Collborator::lookup(array(
+                    'userId'=>$this->getUserId(), 'ticketId'=>$this->getTicketId()));
+        }
 
         return $this->user;
     }
-- 
GitLab