mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 16:46:08 +02:00
- Updated IChatService to include password parameter in JoinChannelAsync method. - Modified ChannelDto and related models to support password functionality. - Implemented password handling in ChannelService for channel creation and membership validation. - Enhanced IrcCommandHandler to manage channel join requests with passwords. - Added ChannelPasswordDialog for user input when joining protected channels. - Created database migration to add PasswordHash column to Channels table. - Updated tests to cover new password functionality in channel joining and management.
31 lines
1.3 KiB
C#
31 lines
1.3 KiB
C#
using EchoHub.Core.DTOs;
|
|
using EchoHub.Core.Models;
|
|
|
|
namespace EchoHub.Core.Contracts;
|
|
|
|
public interface IChatService
|
|
{
|
|
// Connection lifecycle
|
|
Task UserConnectedAsync(string connectionId, Guid userId, string username);
|
|
Task<string?> UserDisconnectedAsync(string connectionId);
|
|
|
|
// Channel operations
|
|
Task<(List<MessageDto> History, string? Error, bool PasswordRequired)> JoinChannelAsync(string connectionId, Guid userId, string username, string channelName, string? password = null);
|
|
Task LeaveChannelAsync(string connectionId, string username, string channelName);
|
|
|
|
// Messaging
|
|
Task<string?> SendMessageAsync(Guid userId, string username, string channelName, string content);
|
|
Task<List<MessageDto>> GetChannelHistoryAsync(string channelName, int count, int offset = 0);
|
|
|
|
// Presence
|
|
Task<string?> UpdateStatusAsync(Guid userId, string username, UserStatus status, string? statusMessage);
|
|
Task<List<UserPresenceDto>> GetOnlineUsersAsync(string channelName);
|
|
|
|
// Broadcasting (used by controllers and IRC gateway)
|
|
Task BroadcastMessageAsync(string channelName, MessageDto message);
|
|
Task BroadcastChannelUpdatedAsync(ChannelDto channel, string? channelName = null);
|
|
|
|
// Query operations (used by IRC gateway for WHOIS)
|
|
Task<List<string>> GetChannelsForUserAsync(string username);
|
|
}
|