Добавить remote-просмотр исходника карточки

RPC TelegramService.ReadSource + ISessionClient.GetMessageAsync, порт ITelegramGateway.ReadSourceAsync и провайдер TelegramSourceContentProvider в ядре; GET /api/cards/{id}/source догружает исходник у сервиса-владельца, в UI — кнопка «Обновить из источника». Медиа-посты пропускаются.
This commit is contained in:
Rustam Khalimov
2026-09-11 17:22:06 +03:00
parent c06ee1cf79
commit db4455a554
30 changed files with 742 additions and 10 deletions
@@ -278,6 +278,30 @@ public sealed class GrpcTelegramClient : ITelegramGateway
}
}
/// <inheritdoc />
public async Task<TelegramSourceContentDto> ReadSourceAsync(
string dialogId,
long msgId,
CancellationToken ct)
{
TenantId tenantId = RequireTenant();
try
{
ReadSourceReply reply = await CallAsync(
tenantId, TimeSpan.FromSeconds(CommandDeadlineSeconds), ct,
(client, options) => client.ReadSourceAsync(
new ReadSourceRequest { DialogId = dialogId ?? string.Empty, MsgId = msgId }, options));
return new TelegramSourceContentDto(
reply.Found,
reply.HasText ? reply.Text : null,
reply.HasTime ? reply.Time : null);
}
catch (Exception exception)
{
throw TranslateTransportFailure(exception, tenantId, "read_source");
}
}
/// <inheritdoc />
public async Task<IReadOnlyList<TelegramDialogEntryDto>> SearchAsync(
string query,
@@ -67,6 +67,13 @@ public sealed class LocalTelegramGateway : ITelegramGateway
CancellationToken ct)
=> Task.FromResult<IReadOnlyList<TelegramRecentMessageDto>>([]);
/// <inheritdoc />
public Task<TelegramSourceContentDto> ReadSourceAsync(
string dialogId,
long msgId,
CancellationToken ct)
=> Task.FromResult(new TelegramSourceContentDto(false, null, null));
/// <inheritdoc />
public Task<IReadOnlyList<TelegramDialogEntryDto>> SearchAsync(
string query,