feat: enhance message decryption for IRC clients and improve attachment handling

This commit is contained in:
HueByte
2026-07-16 16:35:34 +02:00
parent aae788028e
commit b62729dc95
6 changed files with 63 additions and 4 deletions
+10 -2
View File
@@ -16,8 +16,16 @@ public class IrcBroadcaster : IChatBroadcaster
public async Task SendMessageToChannelAsync(string channelName, MessageDto message)
{
// Decrypt content for IRC clients (they can't handle app-layer encryption)
var decryptedMessage = message with { Content = _encryption.Decrypt(message.Content) };
// 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);
foreach (var conn in _gateway.GetConnectionsInChannel(channelName))