Update: Text Channel Stuff
Bugs: Files don't work Bugs: Video In-Line don't work Added: idk, everything?
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
namespace RelayShared.Services;
|
||||
namespace RelayShared.Services;
|
||||
|
||||
public sealed class ChannelItem
|
||||
{
|
||||
public string ChannelId { get; set; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public ChannelType Type { get; set; }
|
||||
|
||||
public string Group { get; set; } = string.Empty;
|
||||
public DateTime CreatedAt { get; set; }
|
||||
public bool IsReadOnly { get; set; }
|
||||
public bool CanPost { get; set; }
|
||||
public bool CanManage { get; set; }
|
||||
}
|
||||
|
||||
public sealed class SocketChannelList
|
||||
{
|
||||
public SignalType Type { get; set; } = SignalType.ChannelList;
|
||||
public List<ChannelItem> Channels { get; set; } = [];
|
||||
}
|
||||
}
|
||||
|
||||
14
RelayShared/Services/ChatMessageContent.cs
Normal file
14
RelayShared/Services/ChatMessageContent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace RelayShared.Services;
|
||||
|
||||
public sealed class ChatMessageContent
|
||||
{
|
||||
public string Text { get; set; } = string.Empty;
|
||||
|
||||
public string? ReplyToId { get; set; }
|
||||
public string? ReplyToSenderUsername { get; set; }
|
||||
public string? ReplyPreview { get; set; }
|
||||
public List<string>? Mentions { get; set; }
|
||||
public string? AttachmentBase64 { get; set; }
|
||||
public string? AttachmentMimeType { get; set; }
|
||||
public string? AttachmentFileName { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace RelayShared.Services;
|
||||
namespace RelayShared.Services;
|
||||
|
||||
//TODO: review name of file, potentially rename for Encryption services rather than sockets
|
||||
|
||||
@@ -16,6 +16,8 @@ public sealed class SocketRtcSignalMessage
|
||||
public sealed class SocketEncryptedMessage
|
||||
{
|
||||
public SignalType Type { get; set; } = SignalType.EncryptedChat;
|
||||
public string MessageId { get; set; } = string.Empty;
|
||||
|
||||
public string SenderUsername { get; set; } = string.Empty;
|
||||
public string RecipientUsername { get; set; } = string.Empty;
|
||||
public string ChannelId { get; set; } = string.Empty;
|
||||
@@ -23,6 +25,38 @@ public sealed class SocketEncryptedMessage
|
||||
public string Nonce { get; set; } = string.Empty;
|
||||
public string Tag { get; set; } = string.Empty;
|
||||
public string EncryptedKey { get; set; } = string.Empty;
|
||||
public bool IsEdited { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
}
|
||||
|
||||
public sealed class SocketMessageDeletedEvent
|
||||
{
|
||||
public SignalType Type { get; set; } = SignalType.MessageDeleted;
|
||||
public string MessageId { get; set; } = string.Empty;
|
||||
public string ChannelId { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public sealed class SocketTypingEvent
|
||||
{
|
||||
public SignalType Type { get; set; } = SignalType.TypingIndicator;
|
||||
public string Username { get; set; } = string.Empty;
|
||||
public string ChannelId { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public sealed class SocketEditHistoryEntry
|
||||
{
|
||||
public string CipherText { get; set; } = string.Empty;
|
||||
public string Nonce { get; set; } = string.Empty;
|
||||
public string Tag { get; set; } = string.Empty;
|
||||
public string EncryptedKey { get; set; } = string.Empty;
|
||||
public DateTime EditedAt { get; set; }
|
||||
}
|
||||
|
||||
public sealed class SocketEditHistoryResponse
|
||||
{
|
||||
public SignalType Type { get; set; } = SignalType.EditHistory;
|
||||
public string MessageId { get; set; } = string.Empty;
|
||||
public List<SocketEditHistoryEntry> Entries { get; set; } = [];
|
||||
}
|
||||
|
||||
public sealed class ServerPublicKeyMessage
|
||||
@@ -44,5 +78,11 @@ public enum SignalType
|
||||
ServerPublicKey,
|
||||
EncryptedSignal,
|
||||
EncryptedChat,
|
||||
ClientEncryptedChat
|
||||
}
|
||||
ClientEncryptedChat,
|
||||
ClientEditMessage,
|
||||
ClientDeleteMessage,
|
||||
MessageEdited,
|
||||
MessageDeleted,
|
||||
TypingIndicator,
|
||||
EditHistory
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace RelayShared.Services;
|
||||
namespace RelayShared.Services;
|
||||
|
||||
public enum WsAction
|
||||
{
|
||||
@@ -8,7 +8,11 @@ public enum WsAction
|
||||
GetChannels,
|
||||
GetHistory,
|
||||
RtcJoin,
|
||||
RtcLeave
|
||||
RtcLeave,
|
||||
SendTyping,
|
||||
GetEditHistory,
|
||||
CreateChannel,
|
||||
DeleteChannel
|
||||
}
|
||||
|
||||
public enum WsEvent
|
||||
@@ -23,8 +27,12 @@ public sealed class WsControlMessage
|
||||
public WsAction Action { get; set; }
|
||||
public string? Username { get; set; }
|
||||
public string? Token { get; set; }
|
||||
public string? ChannelId { get; set; }
|
||||
public string? PublicKey { get; set; }
|
||||
public string? ChannelId { get; set; }
|
||||
public string? MessageId { get; set; }
|
||||
public string? ChannelName { get; set; }
|
||||
public int ChannelType { get; set; } // cast to ChannelType enum
|
||||
public string? ChannelGroup { get; set; }
|
||||
}
|
||||
|
||||
public sealed class WsEventMessage
|
||||
|
||||
Reference in New Issue
Block a user