mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 07:43:31 -07:00
Undo implementation of exporting forwarded messages for the .csv format
This commit is contained in:
parent
6debb1c825
commit
297396f03a
|
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
@ -93,28 +92,11 @@ internal partial class CsvMessageWriter(Stream stream, ExportContext context)
|
||||||
{
|
{
|
||||||
await _writer.WriteAsync(CsvEncode(message.GetFallbackContent()));
|
await _writer.WriteAsync(CsvEncode(message.GetFallbackContent()));
|
||||||
}
|
}
|
||||||
else if (message.ForwardedMessage is not null)
|
|
||||||
{
|
|
||||||
// For forwarded messages, include the forwarded content
|
|
||||||
var forwardedContent = $"[Forwarded] {message.ForwardedMessage.Content}";
|
|
||||||
await _writer.WriteAsync(
|
|
||||||
CsvEncode(await FormatMarkdownAsync(forwardedContent, cancellationToken))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await _writer.WriteAsync(
|
|
||||||
CsvEncode(await FormatMarkdownAsync(message.Content, cancellationToken))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
await _writer.WriteAsync(',');
|
await _writer.WriteAsync(',');
|
||||||
|
|
||||||
// Attachments (include forwarded attachments if present)
|
// Attachments
|
||||||
var allAttachments = message.ForwardedMessage is not null
|
await WriteAttachmentsAsync(message.Attachments, cancellationToken);
|
||||||
? message.Attachments.Concat(message.ForwardedMessage.Attachments).ToList()
|
|
||||||
: message.Attachments;
|
|
||||||
await WriteAttachmentsAsync(allAttachments, cancellationToken);
|
|
||||||
await _writer.WriteAsync(',');
|
await _writer.WriteAsync(',');
|
||||||
|
|
||||||
// Reactions
|
// Reactions
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue