refactor(gmail): route message import through IEmailProvider #9
@@ -951,9 +951,9 @@ public sealed class GmailController : ControllerBase
|
||||
|
||||
private async Task<Correspondence> ImportSingleMessageAsync(string ownerUserId, JobApplication job, string messageId, CancellationToken cancellationToken)
|
||||
{
|
||||
var detail = await _gmail.GetMessageAsync(ownerUserId, messageId, cancellationToken);
|
||||
var me = await _gmail.GetConnectionAsync(ownerUserId, cancellationToken);
|
||||
var gmailAddress = me?.GmailAddress ?? string.Empty;
|
||||
var detail = await Email.GetMessageAsync(ownerUserId, messageId, cancellationToken);
|
||||
var me = await Email.GetConnectionAsync(ownerUserId, cancellationToken);
|
||||
var gmailAddress = me?.Address ?? string.Empty;
|
||||
var isMe = detail.From.Contains(gmailAddress, StringComparison.OrdinalIgnoreCase);
|
||||
var messageDate = detail.Date?.LocalDateTime ?? DateTime.Now;
|
||||
|
||||
@@ -974,7 +974,7 @@ public sealed class GmailController : ControllerBase
|
||||
FileName = attachment.FileName,
|
||||
MimeType = attachment.MimeType,
|
||||
SizeBytes = attachment.SizeBytes,
|
||||
GmailAttachmentId = attachment.GmailAttachmentId,
|
||||
GmailAttachmentId = attachment.ExternalAttachmentId,
|
||||
Inline = attachment.Inline,
|
||||
})),
|
||||
Content = string.IsNullOrWhiteSpace(detail.BodyText) ? detail.Snippet : detail.BodyText,
|
||||
|
||||
Reference in New Issue
Block a user