V17 / d6d373561692
EmailCommands.cs
Lilith/Core/Email/EmailCommands.cs
Unchanged from the preceding versionCS
using Lilith.Core.Commands;
namespace Lilith.Core.Email;
public static class EmailCommands
{
public static void Register(ChatCommandRegistry commands, Func<ProviderClient> provider)
{
commands.Register("email-mode", "Show email mode, or choose unread / since_last_check. No mailbox is read.", c =>
{
if (!string.IsNullOrWhiteSpace(c.Arguments)) provider().SetEmailMode(c.Arguments);
return "Email mode: " + provider().EmailMode;
});
commands.RegisterAsync("email-confirm", "Apply the exact pending local sender rule: /email-confirm ID. Gmail stays unchanged.", async c => new(true, await provider().ConfirmEmailRuleAsync(c.Arguments, c.CancellationToken)));
}
}