feat: add image handling actions and improve IRC message formatting

This commit is contained in:
HueByte
2026-07-17 16:52:15 +02:00
parent b9d099dd73
commit 953e081123
13 changed files with 249 additions and 209 deletions
+4 -11
View File
@@ -16,17 +16,10 @@ public class IrcBroadcaster : IChatBroadcaster
public async Task SendMessageToChannelAsync(string channelName, MessageDto message)
{
// Decrypt content and attachment previews for IRC clients (they can't handle
// app-layer encryption). E2E room ciphertext ($RC1$) passes through untouched;
// the formatter drops previews that are still ciphertext.
var decryptedMessage = message with
{
Content = _encryption.Decrypt(message.Content),
Attachments = message.Attachments?
.Select(a => a with { AsciiPreview = _encryption.DecryptNullable(a.AsciiPreview) })
.ToList(),
};
var lines = IrcMessageFormatter.FormatMessage(decryptedMessage);
// Decrypt transport-encrypted content for IRC clients (they can't handle
// app-layer encryption). E2E room ciphertext ($RC1$) passes through untouched.
var decryptedMessage = message with { Content = _encryption.Decrypt(message.Content) };
var lines = IrcMessageFormatter.FormatMessage(decryptedMessage, _gateway.Options.PublicBaseUrl);
foreach (var conn in _gateway.GetConnectionsInChannel(channelName))
{