Skip to content

Commit

Permalink
und - [0.1.1] Scaffolding for POP3 mail
Browse files Browse the repository at this point in the history
---

Type: und
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jan 27, 2024
1 parent c839c11 commit e0e8c30
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,20 @@ internal class MailShellInit : IAddon
{
private readonly List<CommandInfo> addonCommands =
[
new CommandInfo("mail", /* Localizable */ "Opens the mail client",
new CommandInfo("mail", /* Localizable */ "Opens the IMAP mail client",
[
new CommandArgumentInfo(new[]
{
new CommandArgumentPart(false, "emailAddress"),
})
], new MailCommandExec())
], new MailCommandExec()),
new CommandInfo("popmail", /* Localizable */ "Opens the POP3 mail client",
[
new CommandArgumentInfo(new[]
{
new CommandArgumentPart(false, "emailAddress"),
})
], new PopMailCommandExec()),
];

string IAddon.AddonName =>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// Nitrocid KS Copyright (C) 2018-2024 Aptivi
//
// This file is part of Nitrocid KS
//
// Nitrocid KS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Nitrocid KS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using Nitrocid.ConsoleBase.Colors;
using Nitrocid.ConsoleBase.Writers;
// using Nitrocid.Extras.MailShell.Tools;
using Nitrocid.Languages;
// using Nitrocid.Network.Connections;
// using Nitrocid.Network.SpeedDial;
using Nitrocid.Shell.ShellBase.Commands;

namespace Nitrocid.Extras.MailShell
{
internal class PopMailCommandExec : BaseCommand, ICommand
{

public override int Execute(CommandParameters parameters, ref string variableValue)
{
// Implement on 0.1.1.
TextWriters.Write(Translate.DoTranslation("POP3 mail is returning from 0.0.20.0, but we don't currently plan to release it in this version. Wait for the next version."), KernelColorType.Warning);
// NetworkConnectionTools.OpenConnectionForShell("MailShell", EstablishMailConnection, (_, connection) =>
// EstablishMailConnectionSpeedDial(connection), parameters.ArgumentsText);
return 0;
}

// private NetworkConnection EstablishMailConnection(string username) =>
// string.IsNullOrEmpty(username) ? MailLogin.PromptUser() : MailLogin.PromptPassword(username);

// private NetworkConnection EstablishMailConnectionSpeedDial(SpeedDialEntry connection) =>
// MailLogin.PromptPassword(connection.Options[0].ToString());

}
}

0 comments on commit e0e8c30

Please sign in to comment.