mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
rework media processing a little bit (#191)
* rework media processing a little bit * review changes
This commit is contained in:
@@ -27,10 +27,12 @@ import (
|
||||
"crypto/x509"
|
||||
"encoding/json"
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/go-fed/activity/pub"
|
||||
@@ -1285,6 +1287,25 @@ func NewTestFediPeople() map[string]vocab.ActivityStreamsPerson {
|
||||
}
|
||||
}
|
||||
|
||||
// RemoteAttachmentFile mimics a remote (federated) attachment
|
||||
type RemoteAttachmentFile struct {
|
||||
Data []byte
|
||||
ContentType string
|
||||
}
|
||||
|
||||
func NewTestFediAttachments(relativePath string) map[string]RemoteAttachmentFile {
|
||||
beeBytes, err := os.ReadFile(fmt.Sprintf("%s/beeplushie.jpg", relativePath))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return map[string]RemoteAttachmentFile{
|
||||
"https://s3-us-west-2.amazonaws.com/plushcity/media_attachments/files/106/867/380/219/163/828/original/88e8758c5f011439.jpg": {
|
||||
Data: beeBytes,
|
||||
ContentType: "image/jpeg",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func NewTestFediStatuses() map[string]vocab.ActivityStreamsNote {
|
||||
return map[string]vocab.ActivityStreamsNote{
|
||||
"https://unknown-instance.com/users/brand_new_person/statuses/01FE4NTHKWW7THT67EF10EB839": newNote(
|
||||
|
Reference in New Issue
Block a user