From 010208e5919e2fcf2a853d7252467c16adac7003 Mon Sep 17 00:00:00 2001 From: Thomas Ryan Date: Sun, 13 Oct 2024 00:33:34 -0700 Subject: [PATCH] Fixed the MMS email contents in support of #464. --- Messaging/Program.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Messaging/Program.cs b/Messaging/Program.cs index 341848bd..fb871a75 100644 --- a/Messaging/Program.cs +++ b/Messaging/Program.cs @@ -498,10 +498,15 @@ mediaURLs.Add($"{spacesConfig.ServiceURL}{fileRequest.BucketName}/{fileRequest.Key}"); // For debugging in Ops - if (file.Contains(".txt")) + if (file.EndsWith(".txt")) { - var contextText = await fileDownloadURL.GetStringAsync(); - contents.Add(contextText); + // Open the text file using a stream reader. + using StreamReader reader = new(streamToFile); + + // Read the stream as a string. + string text = await reader.ReadToEndAsync(); + + contents.Add(text); } } } @@ -509,7 +514,7 @@ // Put all of the text into the Content field. foreach (var content in contents) { - messageRecord.Content += $"

{toForward.Content}

"; + messageRecord.Content += $"

{content}

"; } }