mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 16:46:08 +02:00
4.7 KiB
4.7 KiB
v0.2.5 - Audio Playback, File Downloads & IRC Fixes
Features
Audio Message Support
- New
Audiomessage type — uploaded audio files (.mp3,.wav,.ogg,.flac,.aac,.m4a,.wma) are automatically detected and categorized - TUI client renders audio messages with
♪ [Audio: filename] (Enter to play)indicator - Press Enter on an audio message to play it locally via
AudioPlaybackService(NetCoreAudio) - IRC gateway formats audio messages as
♪ [Audio: filename] url - Server detects audio files by extension via
FileValidationHelper.IsAudioFile()
File Downloads
- Press Enter on a file message in the TUI client to download it to the local machine
ApiClient.DownloadFileAsync()streams file downloads from the server- File and audio messages in the chat list now show colored indicators with interaction hints
File Cleanup Service
FileCleanupService(BackgroundService) periodically removes old uploaded files- Configurable via
Storage:CleanupIntervalHours(default 1h) andStorage:RetentionDays(default 30d)
Data Migration Service
DataMigrationServiceruns at startup to handle schema/data evolution- Ensures
#generalchannel and pre-existing channels are marked public - Migrates legacy ANSI escape codes in image messages to printable color tags (
{F:RRGGBB},{B:RRGGBB},{X}) - Migrates legacy single-object
EmbedJsonto array format - Promotes usernames listed in
Server:Adminsconfig to Admin role
True Transparent Background
- Transparent theme now uses the terminal's native background instead of solid black
- Powered by
Color.Transparent(alpha=0) which emits ANSICSI 49m(default background) instead of explicit RGB - Terminal transparency, acrylic, wallpaper effects now show through the TUI
- Dialogs retain solid
DarkGraybackground for readability - Uses local Terminal.Gui fork (submodule) with transparent color support pending upstream merge (gui-cs/Terminal.Gui#4234)
Enhanced Status Bar
- Status bar now shows EchoHub branding at the start
- Connection state is color-coded: green (Connected), red (Disconnected), yellow (transitional states like Connecting, Reconnecting, Authenticating)
- Current channel shows its type:
#channel - publicor#channel - private
#general Channel Protection
#generalchannel is now auto-recreated if somehow missing (both inGetChannelsendpoint andJoinChannelflow)- Users cannot
/leavethe #general channel (client-side guard) - Connecting while already connected now prompts to disconnect first instead of silently leaking the previous connection
Fixes
IRC Gateway
- Fixed: IRC JOIN history replay showed encrypted gibberish —
IrcCommandHandler.HandleJoinAsyncnow decrypts channel history before formatting for IRC clients (history was encrypted for SignalR transport but sent raw to IRC) - Fixed:
JoinedChannelsrace condition —IrcClientConnection.JoinedChannelsreplaced with thread-safe methods (JoinChannel,LeaveChannel,IsInChannel,GetJoinedChannels) using lock synchronization; prevents crashes when broadcaster threads read while the command handler writes - Fixed:
RequireRegisteredfire-and-forget — converted from syncbooltoasync Task<bool>(RequireRegisteredAsync) so the error reply is properly awaited before the handler returns
ChannelService Extraction
- Extracted channel management logic from
ChannelsControllerandChatServiceinto a dedicatedIChannelService/ChannelService ChannelsControlleris now a thin adapter — delegates CRUD operations toIChannelServiceand mapsChannelErrorto HTTP status codesChatService.JoinChannelAsyncdelegates channel validation + membership toIChannelService.EnsureChannelMembershipAsync()- New
ChannelOperationResultresult type withChannelErrorenum for typed error handling across service boundaries - IRC gateway uses
IChannelServicefor topic queries and channel listing (instead ofIChatService)
EchoHub Branding
- Status bar "EchoHub" text now uses golden color (218, 165, 32)
Infrastructure
- Audio MIME types in
FilesController(mp3, wav, ogg, flac, aac, m4a, wma) FakeChannelServicetest helper added for IRC unit tests- Test suites: ChatLine, CommandHandler, DataMigrationService, FileValidationHelper, ImageToAsciiService, IrcMessageFormatter, JwtTokenService, LinkEmbedService
- IRC abstraction layer test suite: IrcMessage parsing, IrcMessageFormatter, IrcClientConnection, IrcCommandHandler, IrcBroadcaster
- Test helpers:
TestDuplexStream,TestIrcConnectionFactory,FakeChatService,FakeChannelService,FakeEncryptionServicefor IRC unit testing without network I/O - 346 total tests