Добавьте S3-вложения с дедупликацией и безопасной сверкой хранилищ
This commit is contained in:
@@ -78,15 +78,16 @@ type MessagePayload struct {
|
||||
ChatID uuid.UUID
|
||||
IdempotencyKey string
|
||||
Text string
|
||||
AttachmentIDs []uuid.UUID
|
||||
}
|
||||
|
||||
// Send checks access and the text on every attempt, a replay included, as the
|
||||
// Send checks access and content on every attempt, a replay included, as the
|
||||
// contract requires of a repeat.
|
||||
func (s *Service) Send(ctx context.Context, actor uuid.UUID, p MessagePayload) (Message, error) {
|
||||
if err := s.requireMember(ctx, actor, p.ChatID); err != nil {
|
||||
return Message{}, err
|
||||
}
|
||||
message, err := NewMessage(ident.New(), p.ChatID, actor, p.Text)
|
||||
message, err := NewMessage(ident.New(), p.ChatID, actor, p.Text, p.AttachmentIDs...)
|
||||
if err != nil {
|
||||
return Message{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user