merged from gramsrv upstream

This commit is contained in:
onysd 2026-09-01 12:06:31 +03:00
parent 79c64ee916
commit 21a0856587
651 changed files with 54774 additions and 4590 deletions

View file

@ -39,6 +39,10 @@ type fakeFiles struct {
webPagePreviewOn bool
getDocumentsCalls int
createUploadCalls int
getFileRequest domain.FileDownloadRequest
getFileChunk domain.FileChunk
getFileFound bool
getFileCalls int
}
type fakeProfilePhotoKey struct {
@ -61,8 +65,10 @@ func (f *fakeFiles) SaveFilePart(context.Context, int64, int64, int, []byte) (bo
func (f *fakeFiles) SaveBigFilePart(context.Context, int64, int64, int, int, []byte) (bool, error) {
return true, nil
}
func (f *fakeFiles) GetFile(context.Context, domain.FileDownloadRequest) (domain.FileChunk, bool, error) {
return domain.FileChunk{}, false, nil
func (f *fakeFiles) GetFile(_ context.Context, req domain.FileDownloadRequest) (domain.FileChunk, bool, error) {
f.getFileCalls++
f.getFileRequest = req
return f.getFileChunk, f.getFileFound, nil
}
func (f *fakeFiles) CreateEncryptedFileFromUpload(context.Context, domain.UploadedFileRef, int) (domain.EncryptedFileRef, error) {
return domain.EncryptedFileRef{ID: 9001, AccessHash: 9002, Size: 16, DCID: 2, KeyFingerprint: 7}, nil