Nullify IProvider

This commit is contained in:
Jordan Dominion
2023-12-17 23:25:32 -05:00
parent b225cbcf9e
commit a574487235
@@ -7,8 +7,6 @@ using Tgstation.Server.Api.Models.Internal;
using Tgstation.Server.Host.Components.Interop;
using Tgstation.Server.Host.Models;
#nullable disable
namespace Tgstation.Server.Host.Components.Chat.Providers
{
/// <summary>
@@ -47,7 +45,7 @@ namespace Tgstation.Server.Host.Components.Chat.Providers
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task{TResult}"/> resulting in the next available <see cref="Message"/> or <see langword="null"/> if the <see cref="IProvider"/> needed to reconnect.</returns>
/// <remarks>Note that private messages will come in the form of <see cref="ChannelRepresentation"/>s not returned in <see cref="MapChannels(IEnumerable{ChatChannel}, CancellationToken)"/>.</remarks>
Task<Message> NextMessage(CancellationToken cancellationToken);
Task<Message?> NextMessage(CancellationToken cancellationToken);
/// <summary>
/// Gracefully disconnects the provider. Permanently stops the reconnection timer.
@@ -67,12 +65,12 @@ namespace Tgstation.Server.Host.Components.Chat.Providers
/// <summary>
/// Send a message to the <see cref="IProvider"/>.
/// </summary>
/// <param name="replyTo">The <see cref="Message"/> to reply to.</param>
/// <param name="replyTo">The optional <see cref="Message"/> to reply to.</param>
/// <param name="message">The <see cref="MessageContent"/>.</param>
/// <param name="channelId">The <see cref="ChannelRepresentation.RealId"/> to send to.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="ValueTask"/> representing the running operation.</returns>
ValueTask SendMessage(Message replyTo, MessageContent message, ulong channelId, CancellationToken cancellationToken);
ValueTask SendMessage(Message? replyTo, MessageContent message, ulong channelId, CancellationToken cancellationToken);
/// <summary>
/// Set the interval at which the provider starts jobs to try to reconnect.
@@ -98,8 +96,8 @@ namespace Tgstation.Server.Host.Components.Chat.Providers
Models.RevisionInformation revisionInformation,
Api.Models.EngineVersion engineVersion,
DateTimeOffset? estimatedCompletionTime,
string gitHubOwner,
string gitHubRepo,
string? gitHubOwner,
string? gitHubRepo,
ulong channelId,
bool localCommitPushed,
CancellationToken cancellationToken);