From db958f4a01ef142840b73489ef348b5de116135f Mon Sep 17 00:00:00 2001
From: Matthew Chen <matthew@signal.org>
Date: Tue, 26 Mar 2019 16:24:01 -0400
Subject: [PATCH] Preserve caption text of edited images.

---
 .../AttachmentApproval/AttachmentApprovalViewController.swift   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift
index 00dd02442..6c674f1b7 100644
--- a/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift
+++ b/SignalMessaging/ViewControllers/AttachmentApproval/AttachmentApprovalViewController.swift
@@ -584,6 +584,8 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC
             owsFailDebug("Could not prepare attachment for output: \(attachmentError).")
             return attachmentItem.attachment
         }
+        // Preserve caption text.
+        dstAttachment.captionText = attachmentItem.captionText
         return dstAttachment
     }