Class ChannelService
public class ChannelService : IChannelService
- Inheritance
-
ChannelService
- Implements
- Inherited Members
Constructors
ChannelService(IServiceScopeFactory, PresenceTracker, ILogger<ChannelService>)
public ChannelService(IServiceScopeFactory scopeFactory, PresenceTracker presenceTracker, ILogger<ChannelService> logger)
Parameters
scopeFactoryIServiceScopeFactorypresenceTrackerPresenceTrackerloggerILogger<ChannelService>
Methods
CreateChannelAsync(Guid, string, string?, bool, string?, string?, string?)
public Task<ChannelOperationResult> CreateChannelAsync(Guid creatorUserId, string name, string? topic, bool isPublic, string? password = null, string? encryptionSalt = null, string? wrappedRoomKey = null)
Parameters
creatorUserIdGuidnamestringtopicstringisPublicboolpasswordstringencryptionSaltstringwrappedRoomKeystring
Returns
- Task<ChannelOperationResult>
DeleteChannelAsync(Guid, string)
public Task<ChannelOperationResult> DeleteChannelAsync(Guid callerUserId, string channelName)
Parameters
Returns
- Task<ChannelOperationResult>
EnsureChannelMembershipAsync(Guid, string, string?)
public Task<(bool Success, string? Error, bool PasswordRequired)> EnsureChannelMembershipAsync(Guid userId, string channelName, string? password = null)
Parameters
Returns
GetChannelByNameAsync(string)
public Task<ChannelDto?> GetChannelByNameAsync(string channelName)
Parameters
channelNamestring
Returns
- Task<ChannelDto>
GetChannelCryptoAsync(string)
public Task<ChannelCryptoDto?> GetChannelCryptoAsync(string channelName)
Parameters
channelNamestring
Returns
- Task<ChannelCryptoDto>
GetChannelKeyEnvelopeAsync(string)
public Task<(string? EncryptionSalt, string? WrappedRoomKey)> GetChannelKeyEnvelopeAsync(string channelName)
Parameters
channelNamestring
Returns
- Task<(string EncryptionSalt, string WrappedRoomKey)>
GetChannelListAsync()
public Task<List<ChannelListItem>> GetChannelListAsync()
Returns
- Task<List<ChannelListItem>>
GetChannelMetaAsync(string)
public Task<ChannelMetaDto?> GetChannelMetaAsync(string channelName)
Parameters
channelNamestring
Returns
- Task<ChannelMetaDto>
GetChannelTopicAsync(string)
public Task<(string? Topic, bool Exists)> GetChannelTopicAsync(string channelName)
Parameters
channelNamestring
Returns
GetChannelsAsync(Guid, int, int)
public Task<PaginatedResponse<ChannelDto>> GetChannelsAsync(Guid userId, int offset, int limit)
Parameters
Returns
- Task<PaginatedResponse<ChannelDto>>
RekeyChannelAsync(Guid, string, string, string, string, string)
Changes an encrypted channel's passphrase by swapping the join-gate hash and the wrapped room key. The room content key itself never changes, so history stays readable — the client re-wraps it under the new passphrase-derived key. Creator only: admins cannot rekey a room whose passphrase they don't know.
public Task<ChannelOperationResult> RekeyChannelAsync(Guid callerUserId, string channelName, string oldPassword, string newPassword, string newEncryptionSalt, string newWrappedRoomKey)
Parameters
callerUserIdGuidchannelNamestringoldPasswordstringnewPasswordstringnewEncryptionSaltstringnewWrappedRoomKeystring
Returns
- Task<ChannelOperationResult>
SetChannelPasswordAsync(Guid, string, string?)
Sets, changes, or clears (null) a channel's join password. Creator or admin only. Not available on end-to-end encrypted channels — those change passphrase via RekeyChannelAsync(Guid, string, string, string, string, string) so the room key envelope stays consistent.
public Task<ChannelOperationResult> SetChannelPasswordAsync(Guid callerUserId, string channelName, string? password)
Parameters
Returns
- Task<ChannelOperationResult>
UpdateTopicAsync(Guid, string, string?)
public Task<ChannelOperationResult> UpdateTopicAsync(Guid callerUserId, string channelName, string? topic)
Parameters
Returns
- Task<ChannelOperationResult>