2023-02-23 21:46:49 +00:00
|
|
|
|
using System.Collections.Generic;
|
2023-02-10 06:07:59 +00:00
|
|
|
|
|
2023-02-23 21:46:49 +00:00
|
|
|
|
namespace SharpChat.EventStorage
|
|
|
|
|
{
|
2023-02-10 06:07:59 +00:00
|
|
|
|
public interface IEventStorage {
|
2023-07-23 21:31:13 +00:00
|
|
|
|
void AddEvent(
|
|
|
|
|
long id, string type,
|
2024-05-10 19:18:55 +00:00
|
|
|
|
object? data = null,
|
2023-07-23 21:31:13 +00:00
|
|
|
|
StoredEventFlags flags = StoredEventFlags.None
|
|
|
|
|
);
|
|
|
|
|
void AddEvent(
|
|
|
|
|
long id, string type,
|
2024-05-10 19:18:55 +00:00
|
|
|
|
string? channelName,
|
|
|
|
|
object? data = null,
|
2023-07-23 21:31:13 +00:00
|
|
|
|
StoredEventFlags flags = StoredEventFlags.None
|
|
|
|
|
);
|
|
|
|
|
void AddEvent(
|
|
|
|
|
long id, string type,
|
2024-05-10 19:18:55 +00:00
|
|
|
|
long senderId, string? senderName, ChatColour senderColour, int senderRank, string? senderNick, ChatUserPermissions senderPerms,
|
|
|
|
|
object? data = null,
|
2023-07-23 21:31:13 +00:00
|
|
|
|
StoredEventFlags flags = StoredEventFlags.None
|
|
|
|
|
);
|
|
|
|
|
void AddEvent(
|
|
|
|
|
long id, string type,
|
2024-05-10 19:18:55 +00:00
|
|
|
|
string? channelName,
|
|
|
|
|
long senderId, string? senderName, ChatColour senderColour, int senderRank, string? senderNick, ChatUserPermissions senderPerms,
|
|
|
|
|
object? data = null,
|
2023-07-23 21:31:13 +00:00
|
|
|
|
StoredEventFlags flags = StoredEventFlags.None
|
|
|
|
|
);
|
|
|
|
|
|
2024-05-10 19:18:55 +00:00
|
|
|
|
long AddEvent(string type, ChatUser user, ChatChannel channel, object? data = null, StoredEventFlags flags = StoredEventFlags.None);
|
2023-02-23 21:46:49 +00:00
|
|
|
|
void RemoveEvent(StoredEventInfo evt);
|
2024-05-10 19:18:55 +00:00
|
|
|
|
StoredEventInfo? GetEvent(long seqId);
|
2023-02-23 21:46:49 +00:00
|
|
|
|
IEnumerable<StoredEventInfo> GetChannelEventLog(string channelName, int amount = 20, int offset = 0);
|
2023-02-10 06:07:59 +00:00
|
|
|
|
}
|
|
|
|
|
}
|