Skip to content
Snippets Groups Projects
Commit ecc699d2 authored by Peter Rotich's avatar Peter Rotich
Browse files

Change from function specific static var to class var

Rename routines to make it a little clear on what they do
parent fe29843b
Branches
Tags
No related merge requests found
......@@ -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);
......
......@@ -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.
......
......@@ -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 ****/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment