Remove unused functions and classes
This commit is contained in:
parent
729930a562
commit
761a82740f
@ -28,12 +28,6 @@ namespace PluralKit.Core {
|
|||||||
public ulong? OriginalMid;
|
public ulong? OriginalMid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ImportedSwitch
|
|
||||||
{
|
|
||||||
public Instant Timestamp;
|
|
||||||
public IReadOnlyCollection<PKMember> Members;
|
|
||||||
}
|
|
||||||
|
|
||||||
public struct SwitchListEntry
|
public struct SwitchListEntry
|
||||||
{
|
{
|
||||||
public ICollection<PKMember> Members;
|
public ICollection<PKMember> Members;
|
||||||
@ -266,12 +260,6 @@ namespace PluralKit.Core {
|
|||||||
/// <param name="postedMessageIds">The IDs of the webhook messages to delete.</param>
|
/// <param name="postedMessageIds">The IDs of the webhook messages to delete.</param>
|
||||||
Task DeleteMessagesBulk(IReadOnlyCollection<ulong> postedMessageIds);
|
Task DeleteMessagesBulk(IReadOnlyCollection<ulong> postedMessageIds);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the most recent message sent by a given account in a given guild.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>The full message object, or null if none was found.</returns>
|
|
||||||
Task<FullMessage> GetLastMessageInGuild(ulong account, ulong guild);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets switches from a system.
|
/// Gets switches from a system.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -283,7 +271,6 @@ namespace PluralKit.Core {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
Task<int> GetSwitchCount(PKSystem system);
|
Task<int> GetSwitchCount(PKSystem system);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the latest (temporally; closest to now) switch of a given system.
|
/// Gets the latest (temporally; closest to now) switch of a given system.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -321,12 +308,6 @@ namespace PluralKit.Core {
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<FrontBreakdown> GetFrontBreakdown(PKSystem system, Instant periodStart, Instant periodEnd);
|
Task<FrontBreakdown> GetFrontBreakdown(PKSystem system, Instant periodStart, Instant periodEnd);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the first listed fronter in a system.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>The first fronter, or null if none are registered.</returns>
|
|
||||||
Task<PKMember> GetFirstFronter(PKSystem system);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers a switch with the given members in the given system.
|
/// Registers a switch with the given members in the given system.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -277,17 +277,6 @@ namespace PluralKit.Core {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<FullMessage> GetLastMessageInGuild(ulong account, ulong guild)
|
|
||||||
{
|
|
||||||
using var conn = await _conn.Obtain();
|
|
||||||
return (await conn.QueryAsync<PKMessage, PKMember, PKSystem, FullMessage>("select messages.*, members.*, systems.* from messages left join members on members.id = messages.member left join systems on systems.id = members.system where messages.guild = @Guild and messages.sender = @Uid order by mid desc limit 1", (msg, member, system) => new FullMessage
|
|
||||||
{
|
|
||||||
Message = msg,
|
|
||||||
System = system,
|
|
||||||
Member = member
|
|
||||||
}, new { Uid = account, Guild = guild })).FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ulong> GetTotalMessages()
|
public async Task<ulong> GetTotalMessages()
|
||||||
{
|
{
|
||||||
using (var conn = await _conn.Obtain())
|
using (var conn = await _conn.Obtain())
|
||||||
@ -340,15 +329,6 @@ namespace PluralKit.Core {
|
|||||||
_logger.Information("Updated guild configuration {@GuildCfg}", cfg);
|
_logger.Information("Updated guild configuration {@GuildCfg}", cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<PKMember> GetFirstFronter(PKSystem system)
|
|
||||||
{
|
|
||||||
// TODO: move to extension method since it doesn't rely on internals
|
|
||||||
var lastSwitch = await GetLatestSwitch(system);
|
|
||||||
if (lastSwitch == null) return null;
|
|
||||||
|
|
||||||
return await GetSwitchMembers(lastSwitch).FirstOrDefaultAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task AddSwitch(PKSystem system, IEnumerable<PKMember> members)
|
public async Task AddSwitch(PKSystem system, IEnumerable<PKMember> members)
|
||||||
{
|
{
|
||||||
// Use a transaction here since we're doing multiple executed commands in one
|
// Use a transaction here since we're doing multiple executed commands in one
|
||||||
|
Loading…
Reference in New Issue
Block a user