From d677fe73839b22fe2065be5a7f6c49a1b11e8c18 Mon Sep 17 00:00:00 2001
From: Malf Furious <m@lfurio.us>
Date: Sun, 4 Jun 2017 15:44:13 -0400
Subject: Update mesg function setAttachment()

Now saving the original name of the attachment file in the message
object.
---
 app/class/mesg.class.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/class/mesg.class.php b/app/class/mesg.class.php
index fd541cd..5d6ba4d 100644
--- a/app/class/mesg.class.php
+++ b/app/class/mesg.class.php
@@ -247,7 +247,13 @@ class mesg extends object
     public function setAttachment(array $file) : bool
     {
         $path = "dynmic/attach/" . $this->guid;
-        return saveFile($file, $path, self::ATTACH_MAXSIZE);
+        $origName = "";
+
+        $ret = saveFile($file, $path, self::ATTACH_MAXSIZE, NULL, $origName);
+        $this->attachment = $origName;
+        $this->saveObj();
+
+        return $ret;
     }
 }
 
-- 
cgit v1.2.3