mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-07 07:36:01 +02:00
feat: add image handling actions and improve IRC message formatting
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user