diff --git a/include/class.filter.php b/include/class.filter.php index 7e26fc8e5729446ef11385caf6d5542928706d1d..ad0b46ee5f717c6f23a5a2938db499c43051910d 100644 --- a/include/class.filter.php +++ b/include/class.filter.php @@ -818,7 +818,7 @@ class TicketFilter { * http://msdn.microsoft.com/en-us/library/ee219609(v=exchg.80).aspx */ /* static */ - function isAutoResponse($headers) { + function isAutoReply($headers) { if($headers && !is_array($headers)) $headers = Mail_Parse::splitHeaders($headers); @@ -852,13 +852,13 @@ class TicketFilter { } # Bounces also counts as auto-responses. - if(self::isAutoBounce($headers)) + if(self::isBounce($headers)) return true; return false; } - function isAutoBounce($headers) { + function isBounce($headers) { if($headers && !is_array($headers)) $headers = Mail_Parse::splitHeaders($headers); diff --git a/include/class.thread.php b/include/class.thread.php index 0151f8cf8482df8d21bf0d12119ef45da1a49c8f..8a1f42ecf0ccce1ef02528dff661e7321900ce4c 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -376,26 +376,26 @@ Class ThreadEntry { return $this->ht['headers']; } - function isAutoResponse() { - static $autoresp; + function isAutoReply() { - if (!isset($autoresp)) - $autoresp = $this->getEmailHeader() ? TicketFilter::isAutoResponse($this->getEmailHeader()) : false; + if (!isset($this->is_autoreply)) + $this->is_autoreply = $this->getEmailHeader() + ? TicketFilter::isAutoReply($this->getEmailHeader()) : false; - return $autoresp; + return $this->is_autoreply; } - function isAutoBounce() { - static $autobounce; + function isBounce() { - if (!isset($autobounce)) - $autobounce = $this->getEmailHeader() ? TicketFilter::isAutoBounce($this->getEmailHeader()) : false; + if (!isset($this->is_bounce)) + $this->is_bounce = $this->getEmailHeader() + ? TicketFilter::isBounce($this->getEmailHeader()) : false; - return $autobounce; + return $this->is_bounce; } - function isAutoReply() { - return ($this->isAutoResponse() || $this->isAutoBounce()); + function isBounceOrAutoReply() { + return ($this->isAutoReply() || $this->isBounce()); } //Web uploads - caller is expected to format, validate and set any errors. diff --git a/include/class.ticket.php b/include/class.ticket.php index 4b54f03a231c92dec51c76f7348bb5040bcabf48..76445c867f099de96e02f73fe2e38f6aec415150 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -783,7 +783,7 @@ class Ticket { $recipients=$sentlist=array(); //Exclude the auto responding email just incase it's from staff member. - if ($message->isAutoResponse()) + if ($message->isAutoReply()) $sentlist[] = $this->getEmail(); //Alert admin?? @@ -1375,7 +1375,7 @@ class Ticket { if(!$alerts) return $message; //Our work is done... $autorespond = true; - if ($autorespond && $message->isAutoReply()) + if ($autorespond && $message->isBounceOrAutoReply()) $autorespond=false; $this->onMessage($autorespond, $message); //must be called b4 sending alerts to staff. @@ -2172,7 +2172,7 @@ class Ticket { //Don't send alerts to staff when the message is a bounce // this is necessary to avoid possible loop (especially on new ticket) - if ($alertstaff && $message->isAutoBounce()) + if ($alertstaff && $message->isBounce()) $alertstaff = false; /***** See if we need to send some alerts ****/