summaryrefslogtreecommitdiffstats
path: root/app/class/mesg.class.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-06-14 00:53:13 -0400
committerMalf Furious <m@lfurio.us>2017-06-19 23:57:39 -0400
commit9fd988bf44089634bd3efa8acc95368cf45c2498 (patch)
treef0690663c004858d08fea14630e1c6d2d9f8ef49 /app/class/mesg.class.php
parent1162f87e4326868160cfddaa524efd1386b34133 (diff)
downloadscrott-9fd988bf44089634bd3efa8acc95368cf45c2498.tar.gz
scrott-9fd988bf44089634bd3efa8acc95368cf45c2498.zip
Update mesg function emailMesg()
Fixed a bug and fine-tuned some of the behavior of this function.
Diffstat (limited to 'app/class/mesg.class.php')
-rw-r--r--app/class/mesg.class.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/class/mesg.class.php b/app/class/mesg.class.php
index da52fa6..2512d03 100644
--- a/app/class/mesg.class.php
+++ b/app/class/mesg.class.php
@@ -297,14 +297,14 @@ class mesg extends object
if (!$parent)
return true;
- $rcpt = $this->getMembers();
- $rcpt[] = $this->getOwner();
+ $rcpt = $parent->getMembers();
+ $rcpt[] = $parent->getOwner();
switch ($parent->objtype)
{
case "user":
$rcpt[] = $parent;
- $subj = $this->author . " PM from " . $this->getAuthor()->getDisplayName();
+ $subj = $this->author . " " . $this->getAuthor()->getDisplayName() . " // " . $this->name;
break;
case "issue":
@@ -322,11 +322,15 @@ class mesg extends object
}
$rcpt = object::arrayUnique($rcpt);
+ $author = $this->author;
+ $rcpt = array_filter($rcpt, function ($val) use($author) { return $val->guid != $author; });
$attachPath = ($this->getAttachment() ? "dynmic/attach/" . $this->guid : NULL);
+ $mesg = $this->getAuthor()->getDisplayName() . " wrote on " . $this->created . "\n\n";
+ $mesg .= $this->renderMesg();
foreach ($rcpt as $r)
{
- if (!$r->sendEmail($subj, $this->mesg, $attachPath, $this->attachment))
+ if (!$r->sendEmail($subj, $mesg, $attachPath, $this->attachment))
return false;
}