Added mailboxes as local data sources (#1022)
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-10-04 12:26:26 +02:00
1 parent 93be539e50
commit c4400c0ff6
343 files changed
+26051 -3122

No files matched your search

@@ -10,6 +10,32 @@ public static partial class SourceExtensions
{
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(SourceExtensions).Namespace, nameof(SourceExtensions));
/// <summary>
/// The scheme of the address a mail leaves as a source, when a mail tool found or read it.
/// </summary>
private const string MAIL_SOURCE_SCHEME = "mailbox";
/// <summary>
/// The address of the source a mail leaves in a chat.
/// </summary>
/// <remarks>
/// Unique per mail, since the sources of a chat are told apart by their address, see
/// MergeSources. No browser and no program can open it; the list of sources shows such a
/// source as text, see IsMailSource.
/// </remarks>
/// <param name="mailboxId">The id of the mailbox.</param>
/// <param name="mailId">The id of the mail.</param>
/// <returns>The address.</returns>
public static string CreateMailSourceUrl(string mailboxId, string mailId) => $"{MAIL_SOURCE_SCHEME}://{mailboxId}/{mailId}";
/// <summary>
/// Whether a source names a mail in one of the mailboxes of the user.
/// </summary>
/// <param name="source">The source.</param>
/// <returns>True for a mail, which nothing can open by its address.</returns>
public static bool IsMailSource(this ISource source) =>
Uri.TryCreate(source.URL.Trim(), UriKind.Absolute, out var address) && address.Scheme.Equals(MAIL_SOURCE_SCHEME, StringComparison.OrdinalIgnoreCase);
private static void AppendMarkdownLink(StringBuilder sb, string title, string url)
{
sb.Append('[');
@@ -153,9 +179,14 @@ public static partial class SourceExtensions
foreach (var numberedSource in group.Sources)
{
var url = keepPageAnchors ? numberedSource.Source.URL : WithoutPageAnchor(numberedSource.Source.URL);
sb.Append($"- [{numberedSource.Number}] ");
AppendMarkdownLink(sb, numberedSource.Source.Title, url);
// A link to a mail would lead nowhere in a document or in the clipboard, so a mail is named only:
if (numberedSource.Source.IsMailSource())
sb.Append(EscapeMarkdownLinkText(numberedSource.Source.Title));
else
AppendMarkdownLink(sb, numberedSource.Source.Title, keepPageAnchors ? numberedSource.Source.URL : WithoutPageAnchor(numberedSource.Source.URL));
sb.AppendLine();
}
}