diff --git a/include/class.thread.php b/include/class.thread.php index aa78f1acb8dc60afffd9d540c38b8fe7664d0cba..48f4d79224a9b0621cfd6aadd0a1876bd14e948d 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; }