Merge remote-tracking branch 'upstream/main'

This commit is contained in:
kim 2022-06-22 11:38:04 +01:00
commit c6af3b3cff
18 changed files with 1509 additions and 1447 deletions

View file

@ -28,7 +28,7 @@ steps:
- pull_request - pull_request
- name: test - name: test
image: golang:1.18-alpine image: golang:1.18.3-alpine
volumes: volumes:
- name: go-build-cache - name: go-build-cache
path: /root/.cache/go-build path: /root/.cache/go-build
@ -45,7 +45,7 @@ steps:
- pull_request - pull_request
- name: snapshot - name: snapshot
image: superseriousbusiness/gotosocial-drone-build:0.0.4 # https://github.com/superseriousbusiness/gotosocial-drone-build image: superseriousbusiness/gotosocial-drone-build:0.0.5 # https://github.com/superseriousbusiness/gotosocial-drone-build
volumes: volumes:
- name: go-build-cache - name: go-build-cache
path: /root/.cache/go-build path: /root/.cache/go-build
@ -74,7 +74,7 @@ steps:
- main - main
- name: release - name: release
image: superseriousbusiness/gotosocial-drone-build:0.0.4 # https://github.com/superseriousbusiness/gotosocial-drone-build image: superseriousbusiness/gotosocial-drone-build:0.0.5 # https://github.com/superseriousbusiness/gotosocial-drone-build
volumes: volumes:
- name: go-build-cache - name: go-build-cache
path: /root/.cache/go-build path: /root/.cache/go-build
@ -133,7 +133,7 @@ clone:
steps: steps:
- name: mirror - name: mirror
image: superseriousbusiness/gotosocial-drone-build:0.0.4 image: superseriousbusiness/gotosocial-drone-build:0.0.5
environment: environment:
ORIGIN_REPO: https://github.com/superseriousbusiness/gotosocial ORIGIN_REPO: https://github.com/superseriousbusiness/gotosocial
TARGET_REPO: https://codeberg.org/superseriousbusiness/gotosocial TARGET_REPO: https://codeberg.org/superseriousbusiness/gotosocial
@ -146,6 +146,6 @@ steps:
--- ---
kind: signature kind: signature
hmac: adfcc11559717e4e371e714f3ac19ab528208f678961436f316f491bf82de8ad hmac: d696d93f3d1583b9815488fcd2ff1ade53a5d7512abac63f16bd8cd0079f03a5
... ...

View file

@ -142,17 +142,27 @@ docker_manifests:
archives: archives:
# https://goreleaser.com/customization/archive/ # https://goreleaser.com/customization/archive/
- -
id: binary-release
files: files:
# standard release files # standard release files
- LICENSE - LICENSE
- README.md - README.md
- CHANGELOG* - CHANGELOG*
# web assets # web stuff minus source
- web/assets - web/assets
- web/template - web/template
# example config files # example config files
- example/config.yaml - example/config.yaml
- example/gotosocial.service - example/gotosocial.service
-
id: web-assets
files:
- LICENSE
# just the web stuff minus source
- web/assets
- web/template
meta: true
name_template: "{{ .ProjectName }}_{{ .Version }}_web-assets"
checksum: checksum:
# https://goreleaser.com/customization/checksum/ # https://goreleaser.com/customization/checksum/
name_template: 'checksums.txt' name_template: 'checksums.txt'
@ -161,4 +171,4 @@ snapshot:
name_template: "{{ incpatch .Version }}-SNAPSHOT" name_template: "{{ incpatch .Version }}-SNAPSHOT"
source: source:
# https://goreleaser.com/customization/source/ # https://goreleaser.com/customization/source/
enabled: true enabled: false

View file

@ -81,7 +81,7 @@ func (suite *MediaCleanupTestSuite) TestMediaCleanupNoArg() {
suite.NoError(err) suite.NoError(err)
// the media should no longer be cached // the media should no longer be cached
suite.True(prunedAttachment.Cached) suite.False(prunedAttachment.Cached)
} }
func (suite *MediaCleanupTestSuite) TestMediaCleanupNotOldEnough() { func (suite *MediaCleanupTestSuite) TestMediaCleanupNotOldEnough() {
@ -90,7 +90,7 @@ func (suite *MediaCleanupTestSuite) TestMediaCleanupNotOldEnough() {
// set up the request // set up the request
recorder := httptest.NewRecorder() recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, []byte("{\"remote_cache_days\": 3}"), admin.EmojiPath, "application/json") ctx := suite.newContext(recorder, http.MethodPost, []byte("{\"remote_cache_days\": 10000}"), admin.EmojiPath, "application/json")
// call the handler // call the handler
suite.adminModule.MediaCleanupPOSTHandler(ctx) suite.adminModule.MediaCleanupPOSTHandler(ctx)

View file

@ -28,7 +28,7 @@
func init() { func init() {
up := func(ctx context.Context, db *bun.DB) error { up := func(ctx context.Context, db *bun.DB) error {
_, err := db.ExecContext(ctx, "ALTER TABLE ? ADD COLUMN ? TEXT", bun.Ident("accounts"), bun.Ident("note_raw")) _, err := db.ExecContext(ctx, "ALTER TABLE ? ADD COLUMN ? TEXT", bun.Ident("accounts"), bun.Ident("note_raw"))
if err != nil && !(strings.Contains(err.Error(), "already exists") || strings.Contains(err.Error(), "duplicate column name")) { if err != nil && !(strings.Contains(err.Error(), "already exists") || strings.Contains(err.Error(), "duplicate column name") || strings.Contains(err.Error(), "SQLSTATE 42701")) {
return err return err
} }
return nil return nil

View file

@ -28,7 +28,7 @@
func init() { func init() {
up := func(ctx context.Context, db *bun.DB) error { up := func(ctx context.Context, db *bun.DB) error {
_, err := db.ExecContext(ctx, "ALTER TABLE ? ADD COLUMN ? TEXT", bun.Ident("accounts"), bun.Ident("note_raw")) _, err := db.ExecContext(ctx, "ALTER TABLE ? ADD COLUMN ? TEXT", bun.Ident("accounts"), bun.Ident("note_raw"))
if err != nil && !(strings.Contains(err.Error(), "already exists") || strings.Contains(err.Error(), "duplicate column name")) { if err != nil && !(strings.Contains(err.Error(), "already exists") || strings.Contains(err.Error(), "duplicate column name") || strings.Contains(err.Error(), "SQLSTATE 42701")) {
return err return err
} }
return nil return nil

View file

@ -21,7 +21,6 @@
import ( import (
"context" "context"
"testing" "testing"
"time"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/ap" "github.com/superseriousbusiness/gotosocial/internal/ap"
@ -122,8 +121,6 @@ func (suite *StatusTestSuite) TestDereferenceStatusWithMention() {
suite.Equal(account.ID, m.OriginAccountID) suite.Equal(account.ID, m.OriginAccountID)
suite.Equal(fetchingAccount.ID, m.TargetAccountID) suite.Equal(fetchingAccount.ID, m.TargetAccountID)
suite.Equal(account.URI, m.OriginAccountURI) suite.Equal(account.URI, m.OriginAccountURI)
suite.WithinDuration(time.Now(), m.CreatedAt, 5*time.Minute)
suite.WithinDuration(time.Now(), m.UpdatedAt, 5*time.Minute)
suite.False(m.Silent) suite.False(m.Silent)
} }

View file

@ -85,14 +85,17 @@ func (p *processor) SearchGet(ctx context.Context, authed *oauth.Auth, search *a
*/ */
if !foundOne { if !foundOne {
if uri, err := url.Parse(query); err == nil && (uri.Scheme == "https" || uri.Scheme == "http") { if uri, err := url.Parse(query); err == nil && (uri.Scheme == "https" || uri.Scheme == "http") {
// 1. check if it's a status // don't attempt to resolve (ie., dereference) local accounts/statuses
if foundStatus, err := p.searchStatusByURI(ctx, authed, uri, search.Resolve); err == nil && foundStatus != nil { resolve := search.Resolve
foundStatuses = append(foundStatuses, foundStatus) if uri.Host == config.GetHost() || uri.Host == config.GetAccountDomain() {
l.Debug("got a status by searching by URI") resolve = false
} }
// 2. check if it's an account // check if it's a status or an account
if foundAccount, err := p.searchAccountByURI(ctx, authed, uri, search.Resolve); err == nil && foundAccount != nil { if foundStatus, err := p.searchStatusByURI(ctx, authed, uri, resolve); err == nil && foundStatus != nil {
foundStatuses = append(foundStatuses, foundStatus)
l.Debug("got a status by searching by URI")
} else if foundAccount, err := p.searchAccountByURI(ctx, authed, uri, resolve); err == nil && foundAccount != nil {
foundAccounts = append(foundAccounts, foundAccount) foundAccounts = append(foundAccounts, foundAccount)
l.Debug("got an account by searching by URI") l.Debug("got an account by searching by URI")
} }

View file

@ -23,6 +23,7 @@
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"math/rand"
"net/http" "net/http"
"strings" "strings"
@ -35,6 +36,21 @@
"github.com/superseriousbusiness/gotosocial/internal/oauth" "github.com/superseriousbusiness/gotosocial/internal/oauth"
) )
var randAvatars = make(map[string]string)
func (m *Module) ensureAvatar(status apimodel.Status) {
if status.Account.Avatar == "" && len(m.defaultAvatars) > 0 {
avatar, ok := randAvatars[status.Account.ID]
if !ok {
//nolint:gosec
randomIndex := rand.Intn(len(m.defaultAvatars))
avatar = m.defaultAvatars[randomIndex]
randAvatars[status.Account.ID] = avatar
}
status.Account.Avatar = avatar
}
}
func (m *Module) threadGETHandler(c *gin.Context) { func (m *Module) threadGETHandler(c *gin.Context) {
ctx := c.Request.Context() ctx := c.Request.Context()
@ -104,6 +120,16 @@ func (m *Module) threadGETHandler(c *gin.Context) {
return return
} }
m.ensureAvatar(*status)
for _, status := range context.Descendants {
m.ensureAvatar(status)
}
for _, status := range context.Ancestors {
m.ensureAvatar(status)
}
c.HTML(http.StatusOK, "thread.tmpl", gin.H{ c.HTML(http.StatusOK, "thread.tmpl", gin.H{
"instance": instance, "instance": instance,
"status": status, "status": status,

View file

@ -53,8 +53,8 @@ func NewTestTokens() map[string]*gtsmodel.Token {
RedirectURI: "http://localhost:8080", RedirectURI: "http://localhost:8080",
Scope: "read write follow push", Scope: "read write follow push",
Access: "NZAZOTC0OWITMDU0NC0ZODG4LWE4NJITMWUXM2M4MTRHZDEX", Access: "NZAZOTC0OWITMDU0NC0ZODG4LWE4NJITMWUXM2M4MTRHZDEX",
AccessCreateAt: time.Now(), AccessCreateAt: TimeMustParse("2022-06-10T15:22:08Z"),
AccessExpiresAt: time.Now().Add(72 * time.Hour), AccessExpiresAt: TimeMustParse("2050-01-01T15:22:08Z"),
}, },
"local_account_1_client_application_token": { "local_account_1_client_application_token": {
ID: "01P9SVWS9J3SPHZQ3KCMBEN70N", ID: "01P9SVWS9J3SPHZQ3KCMBEN70N",
@ -80,8 +80,8 @@ func NewTestTokens() map[string]*gtsmodel.Token {
RedirectURI: "http://localhost:8080", RedirectURI: "http://localhost:8080",
Scope: "read write follow push", Scope: "read write follow push",
Access: "PIPINALKNNNFNF98717NAMNAMNFKIJKJ881818KJKJAKJJJA", Access: "PIPINALKNNNFNF98717NAMNAMNFKIJKJ881818KJKJAKJJJA",
AccessCreateAt: time.Now(), AccessCreateAt: TimeMustParse("2022-06-10T15:22:08Z"),
AccessExpiresAt: time.Now().Add(72 * time.Hour), AccessExpiresAt: TimeMustParse("2050-01-01T15:22:08Z"),
}, },
"admin_account": { "admin_account": {
ID: "01FS4TP8ANA5VE92EAPA9E0M7Q", ID: "01FS4TP8ANA5VE92EAPA9E0M7Q",
@ -90,8 +90,8 @@ func NewTestTokens() map[string]*gtsmodel.Token {
RedirectURI: "http://localhost:8080", RedirectURI: "http://localhost:8080",
Scope: "read write follow push admin", Scope: "read write follow push admin",
Access: "AININALKNENFNF98717NAMG4LWE4NJITMWUXM2M4MTRHZDEX", Access: "AININALKNENFNF98717NAMG4LWE4NJITMWUXM2M4MTRHZDEX",
AccessCreateAt: time.Now(), AccessCreateAt: TimeMustParse("2022-06-10T15:22:08Z"),
AccessExpiresAt: time.Now().Add(72 * time.Hour), AccessExpiresAt: TimeMustParse("2050-01-01T15:22:08Z"),
}, },
} }
return tokens return tokens
@ -164,7 +164,7 @@ func NewTestUsers() map[string]*gtsmodel.User {
Email: "", Email: "",
AccountID: "01F8MH0BBE4FHXPH513MBVFHB0", AccountID: "01F8MH0BBE4FHXPH513MBVFHB0",
EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password' EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password'
CreatedAt: time.Now(), CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
SignUpIP: net.ParseIP("199.222.111.89"), SignUpIP: net.ParseIP("199.222.111.89"),
UpdatedAt: time.Time{}, UpdatedAt: time.Time{},
CurrentSignInAt: time.Time{}, CurrentSignInAt: time.Time{},
@ -180,7 +180,7 @@ func NewTestUsers() map[string]*gtsmodel.User {
LastEmailedAt: time.Time{}, LastEmailedAt: time.Time{},
ConfirmationToken: "a5a280bd-34be-44a3-8330-a57eaf61b8dd", ConfirmationToken: "a5a280bd-34be-44a3-8330-a57eaf61b8dd",
ConfirmedAt: time.Time{}, ConfirmedAt: time.Time{},
ConfirmationSentAt: time.Now(), ConfirmationSentAt: TimeMustParse("2022-06-04T13:12:00Z"),
UnconfirmedEmail: "weed_lord420@example.org", UnconfirmedEmail: "weed_lord420@example.org",
Moderator: false, Moderator: false,
Admin: false, Admin: false,
@ -194,12 +194,12 @@ func NewTestUsers() map[string]*gtsmodel.User {
Email: "admin@example.org", Email: "admin@example.org",
AccountID: "01F8MH17FWEB39HZJ76B6VXSKF", AccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password' EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password'
CreatedAt: time.Now().Add(-72 * time.Hour), CreatedAt: TimeMustParse("2022-06-01T13:12:00Z"),
SignUpIP: net.ParseIP("89.22.189.19"), SignUpIP: net.ParseIP("89.22.189.19"),
UpdatedAt: time.Now().Add(-72 * time.Hour), UpdatedAt: TimeMustParse("2022-06-01T13:12:00Z"),
CurrentSignInAt: time.Now().Add(-10 * time.Minute), CurrentSignInAt: TimeMustParse("2022-06-04T13:12:00Z"),
CurrentSignInIP: net.ParseIP("89.122.255.1"), CurrentSignInIP: net.ParseIP("89.122.255.1"),
LastSignInAt: time.Now().Add(-2 * time.Hour), LastSignInAt: TimeMustParse("2022-06-03T13:12:00Z"),
LastSignInIP: net.ParseIP("89.122.255.1"), LastSignInIP: net.ParseIP("89.122.255.1"),
SignInCount: 78, SignInCount: 78,
InviteID: "", InviteID: "",
@ -207,9 +207,9 @@ func NewTestUsers() map[string]*gtsmodel.User {
FilteredLanguages: []string{}, FilteredLanguages: []string{},
Locale: "en", Locale: "en",
CreatedByApplicationID: "01F8MGXQRHYF5QPMTMXP78QC2F", CreatedByApplicationID: "01F8MGXQRHYF5QPMTMXP78QC2F",
LastEmailedAt: time.Now().Add(-30 * time.Minute), LastEmailedAt: TimeMustParse("2022-06-03T13:12:00Z"),
ConfirmationToken: "", ConfirmationToken: "",
ConfirmedAt: time.Now().Add(-72 * time.Hour), ConfirmedAt: TimeMustParse("2022-06-02T13:12:00Z"),
ConfirmationSentAt: time.Time{}, ConfirmationSentAt: time.Time{},
UnconfirmedEmail: "", UnconfirmedEmail: "",
Moderator: true, Moderator: true,
@ -224,12 +224,12 @@ func NewTestUsers() map[string]*gtsmodel.User {
Email: "zork@example.org", Email: "zork@example.org",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password' EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password'
CreatedAt: time.Now().Add(-36 * time.Hour), CreatedAt: TimeMustParse("2022-06-01T13:12:00Z"),
SignUpIP: net.ParseIP("59.99.19.172"), SignUpIP: net.ParseIP("59.99.19.172"),
UpdatedAt: time.Now().Add(-72 * time.Hour), UpdatedAt: TimeMustParse("2022-06-01T13:12:00Z"),
CurrentSignInAt: time.Now().Add(-30 * time.Minute), CurrentSignInAt: TimeMustParse("2022-06-04T13:12:00Z"),
CurrentSignInIP: net.ParseIP("88.234.118.16"), CurrentSignInIP: net.ParseIP("88.234.118.16"),
LastSignInAt: time.Now().Add(-2 * time.Hour), LastSignInAt: TimeMustParse("2022-06-03T13:12:00Z"),
LastSignInIP: net.ParseIP("147.111.231.154"), LastSignInIP: net.ParseIP("147.111.231.154"),
SignInCount: 9, SignInCount: 9,
InviteID: "", InviteID: "",
@ -237,10 +237,10 @@ func NewTestUsers() map[string]*gtsmodel.User {
FilteredLanguages: []string{}, FilteredLanguages: []string{},
Locale: "en", Locale: "en",
CreatedByApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG", CreatedByApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
LastEmailedAt: time.Now().Add(-55 * time.Minute), LastEmailedAt: TimeMustParse("2022-06-02T13:12:00Z"),
ConfirmationToken: "", ConfirmationToken: "",
ConfirmedAt: time.Now().Add(-34 * time.Hour), ConfirmedAt: TimeMustParse("2022-06-02T13:12:00Z"),
ConfirmationSentAt: time.Now().Add(-36 * time.Hour), ConfirmationSentAt: TimeMustParse("2022-06-02T13:12:00Z"),
UnconfirmedEmail: "", UnconfirmedEmail: "",
Moderator: false, Moderator: false,
Admin: false, Admin: false,
@ -254,12 +254,12 @@ func NewTestUsers() map[string]*gtsmodel.User {
Email: "tortle.dude@example.org", Email: "tortle.dude@example.org",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password' EncryptedPassword: "$2y$10$ggWz5QWwnx6kzb9g0tnIJurFtE0dhr5Zfeaqs9iFuUIXzafQlJVZS", // 'password'
CreatedAt: time.Now().Add(-36 * time.Hour), CreatedAt: TimeMustParse("2022-05-23T13:12:00Z"),
SignUpIP: net.ParseIP("59.99.19.172"), SignUpIP: net.ParseIP("59.99.19.172"),
UpdatedAt: time.Now().Add(-72 * time.Hour), UpdatedAt: TimeMustParse("2022-05-23T13:12:00Z"),
CurrentSignInAt: time.Now().Add(-30 * time.Minute), CurrentSignInAt: TimeMustParse("2022-06-05T13:12:00Z"),
CurrentSignInIP: net.ParseIP("118.44.18.196"), CurrentSignInIP: net.ParseIP("118.44.18.196"),
LastSignInAt: time.Now().Add(-2 * time.Hour), LastSignInAt: TimeMustParse("2022-06-06T13:12:00Z"),
LastSignInIP: net.ParseIP("198.98.21.15"), LastSignInIP: net.ParseIP("198.98.21.15"),
SignInCount: 9, SignInCount: 9,
InviteID: "", InviteID: "",
@ -267,10 +267,10 @@ func NewTestUsers() map[string]*gtsmodel.User {
FilteredLanguages: []string{}, FilteredLanguages: []string{},
Locale: "en", Locale: "en",
CreatedByApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG", CreatedByApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
LastEmailedAt: time.Now().Add(-55 * time.Minute), LastEmailedAt: TimeMustParse("2022-06-06T13:12:00Z"),
ConfirmationToken: "", ConfirmationToken: "",
ConfirmedAt: time.Now().Add(-34 * time.Hour), ConfirmedAt: TimeMustParse("2022-05-24T13:12:00Z"),
ConfirmationSentAt: time.Now().Add(-36 * time.Hour), ConfirmationSentAt: TimeMustParse("2022-05-23T13:12:00Z"),
UnconfirmedEmail: "", UnconfirmedEmail: "",
Moderator: false, Moderator: false,
Admin: false, Admin: false,
@ -297,8 +297,8 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
Note: "", Note: "",
Memorial: false, Memorial: false,
MovedToAccountID: "", MovedToAccountID: "",
CreatedAt: time.Now(), CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
UpdatedAt: time.Now(), UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
Bot: false, Bot: false,
Reason: "hi, please let me in! I'm looking for somewhere neato bombeato to hang out.", Reason: "hi, please let me in! I'm looking for somewhere neato bombeato to hang out.",
Locked: false, Locked: false,
@ -414,8 +414,8 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
NoteRaw: "i post about things that concern me", NoteRaw: "i post about things that concern me",
Memorial: false, Memorial: false,
MovedToAccountID: "", MovedToAccountID: "",
CreatedAt: time.Now().Add(-190 * time.Hour), CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
UpdatedAt: time.Now().Add(-36 * time.Hour), UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
Bot: false, Bot: false,
Reason: "", Reason: "",
Locked: true, Locked: true,
@ -452,7 +452,7 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
Memorial: false, Memorial: false,
MovedToAccountID: "", MovedToAccountID: "",
CreatedAt: TimeMustParse("2021-09-26T12:52:36+02:00"), CreatedAt: TimeMustParse("2021-09-26T12:52:36+02:00"),
UpdatedAt: time.Now().Add(-36 * time.Hour), UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
Bot: false, Bot: false,
Locked: false, Locked: false,
Discoverable: true, Discoverable: true,
@ -487,7 +487,7 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
Memorial: false, Memorial: false,
MovedToAccountID: "", MovedToAccountID: "",
CreatedAt: TimeMustParse("2020-08-10T14:13:28+02:00"), CreatedAt: TimeMustParse("2020-08-10T14:13:28+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Hour), UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
Bot: false, Bot: false,
Locked: true, Locked: true,
Discoverable: true, Discoverable: true,
@ -571,8 +571,8 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
StatusID: "01F8MH75CBF9JFX4ZAD54N0W0R", StatusID: "01F8MH75CBF9JFX4ZAD54N0W0R",
URL: "http://localhost:8080/fileserver/01F8MH17FWEB39HZJ76B6VXSKF/attachment/original/01F8MH6NEM8D7527KZAECTCR76.jpeg", URL: "http://localhost:8080/fileserver/01F8MH17FWEB39HZJ76B6VXSKF/attachment/original/01F8MH6NEM8D7527KZAECTCR76.jpeg",
RemoteURL: "", RemoteURL: "",
CreatedAt: time.Now().Add(-71 * time.Hour), CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
UpdatedAt: time.Now().Add(-71 * time.Hour), UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
Type: gtsmodel.FileTypeImage, Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{ FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{ Original: gtsmodel.Original{
@ -597,13 +597,13 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
Path: "01F8MH17FWEB39HZJ76B6VXSKF/attachment/original/01F8MH6NEM8D7527KZAECTCR76.jpeg", Path: "01F8MH17FWEB39HZJ76B6VXSKF/attachment/original/01F8MH6NEM8D7527KZAECTCR76.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 62529, FileSize: 62529,
UpdatedAt: time.Now().Add(-71 * time.Hour), UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
}, },
Thumbnail: gtsmodel.Thumbnail{ Thumbnail: gtsmodel.Thumbnail{
Path: "01F8MH17FWEB39HZJ76B6VXSKF/attachment/small/01F8MH6NEM8D7527KZAECTCR76.jpeg", Path: "01F8MH17FWEB39HZJ76B6VXSKF/attachment/small/01F8MH6NEM8D7527KZAECTCR76.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 6872, FileSize: 6872,
UpdatedAt: time.Now().Add(-71 * time.Hour), UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
URL: "http://localhost:8080/fileserver/01F8MH17FWEB39HZJ76B6VXSKF/attachment/small/01F8MH6NEM8D7527KZAECTCR76.jpeg", URL: "http://localhost:8080/fileserver/01F8MH17FWEB39HZJ76B6VXSKF/attachment/small/01F8MH6NEM8D7527KZAECTCR76.jpeg",
RemoteURL: "", RemoteURL: "",
}, },
@ -616,8 +616,8 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
StatusID: "01F8MH82FYRXD2RC6108DAJ5HB", StatusID: "01F8MH82FYRXD2RC6108DAJ5HB",
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01F8MH7TDVANYKWVE8VVKFPJTJ.gif", URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01F8MH7TDVANYKWVE8VVKFPJTJ.gif",
RemoteURL: "", RemoteURL: "",
CreatedAt: time.Now().Add(-1 * time.Hour), CreatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
UpdatedAt: time.Now().Add(-1 * time.Hour), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
Type: gtsmodel.FileTypeGif, Type: gtsmodel.FileTypeGif,
FileMeta: gtsmodel.FileMeta{ FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{ Original: gtsmodel.Original{
@ -646,13 +646,13 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01F8MH7TDVANYKWVE8VVKFPJTJ.gif", Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01F8MH7TDVANYKWVE8VVKFPJTJ.gif",
ContentType: "image/gif", ContentType: "image/gif",
FileSize: 1109138, FileSize: 1109138,
UpdatedAt: time.Now().Add(-1 * time.Hour), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
}, },
Thumbnail: gtsmodel.Thumbnail{ Thumbnail: gtsmodel.Thumbnail{
Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01F8MH7TDVANYKWVE8VVKFPJTJ.jpeg", Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01F8MH7TDVANYKWVE8VVKFPJTJ.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 8803, FileSize: 8803,
UpdatedAt: time.Now().Add(-1 * time.Hour), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01F8MH7TDVANYKWVE8VVKFPJTJ.jpeg", URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01F8MH7TDVANYKWVE8VVKFPJTJ.jpeg",
RemoteURL: "", RemoteURL: "",
}, },
@ -665,8 +665,8 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
StatusID: "", // this attachment isn't connected to a status YET StatusID: "", // this attachment isn't connected to a status YET
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpeg", URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpeg",
RemoteURL: "", RemoteURL: "",
CreatedAt: time.Now().Add(30 * time.Second), CreatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
UpdatedAt: time.Now().Add(30 * time.Second), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
Type: gtsmodel.FileTypeGif, Type: gtsmodel.FileTypeGif,
FileMeta: gtsmodel.FileMeta{ FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{ Original: gtsmodel.Original{
@ -695,13 +695,13 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpeg", Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 27759, FileSize: 27759,
UpdatedAt: time.Now().Add(30 * time.Second), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
}, },
Thumbnail: gtsmodel.Thumbnail{ Thumbnail: gtsmodel.Thumbnail{
Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpeg", Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 6177, FileSize: 6177,
UpdatedAt: time.Now().Add(30 * time.Second), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpeg", URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpeg",
RemoteURL: "", RemoteURL: "",
}, },
@ -714,8 +714,8 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
StatusID: "", // this attachment isn't connected to a status StatusID: "", // this attachment isn't connected to a status
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpeg", URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpeg",
RemoteURL: "", RemoteURL: "",
CreatedAt: time.Now().Add(-47 * time.Hour), CreatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
UpdatedAt: time.Now().Add(-47 * time.Hour), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
Type: gtsmodel.FileTypeImage, Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{ FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{ Original: gtsmodel.Original{
@ -744,13 +744,13 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
Path: "01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpeg", Path: "01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 457680, FileSize: 457680,
UpdatedAt: time.Now().Add(-47 * time.Hour), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
}, },
Thumbnail: gtsmodel.Thumbnail{ Thumbnail: gtsmodel.Thumbnail{
Path: "01F8MH1H7YV1Z7D2C8K2730QBF/avatar/small/01F8MH58A357CV5K7R7TJMSH6S.jpeg", Path: "01F8MH1H7YV1Z7D2C8K2730QBF/avatar/small/01F8MH58A357CV5K7R7TJMSH6S.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 15374, FileSize: 15374,
UpdatedAt: time.Now().Add(-47 * time.Hour), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/small/01F8MH58A357CV5K7R7TJMSH6S.jpeg", URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/small/01F8MH58A357CV5K7R7TJMSH6S.jpeg",
RemoteURL: "", RemoteURL: "",
}, },
@ -763,8 +763,8 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
StatusID: "", StatusID: "",
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpeg", URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpeg",
RemoteURL: "", RemoteURL: "",
CreatedAt: time.Now().Add(-47 * time.Hour), CreatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
UpdatedAt: time.Now().Add(-47 * time.Hour), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
Type: gtsmodel.FileTypeImage, Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{ FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{ Original: gtsmodel.Original{
@ -793,13 +793,13 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
Path: "01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpeg", Path: "01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 517226, FileSize: 517226,
UpdatedAt: time.Now().Add(-47 * time.Hour), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
}, },
Thumbnail: gtsmodel.Thumbnail{ Thumbnail: gtsmodel.Thumbnail{
Path: "01F8MH1H7YV1Z7D2C8K2730QBF/header/small/01PFPMWK2FF0D9WMHEJHR07C3Q.jpeg", Path: "01F8MH1H7YV1Z7D2C8K2730QBF/header/small/01PFPMWK2FF0D9WMHEJHR07C3Q.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 42308, FileSize: 42308,
UpdatedAt: time.Now().Add(-47 * time.Hour), UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/small/01PFPMWK2FF0D9WMHEJHR07C3Q.jpeg", URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/small/01PFPMWK2FF0D9WMHEJHR07C3Q.jpeg",
RemoteURL: "", RemoteURL: "",
}, },
@ -861,8 +861,8 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
StatusID: "01FVW7JHQFSFK166WWKR8CBA6M", StatusID: "01FVW7JHQFSFK166WWKR8CBA6M",
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01FVW7RXPQ8YJHTEXYPE7Q8ZY0.jpeg", URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01FVW7RXPQ8YJHTEXYPE7Q8ZY0.jpeg",
RemoteURL: "http://fossbros-anonymous.io/attachments/original/13bbc3f8-2b5e-46ea-9531-40b4974d9912.jpeg", RemoteURL: "http://fossbros-anonymous.io/attachments/original/13bbc3f8-2b5e-46ea-9531-40b4974d9912.jpeg",
CreatedAt: time.Now().Add(-48 * time.Hour), CreatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-48 * time.Hour), UpdatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
Type: gtsmodel.FileTypeImage, Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{ FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{ Original: gtsmodel.Original{
@ -891,13 +891,13 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01FVW7RXPQ8YJHTEXYPE7Q8ZY0.jpeg", Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01FVW7RXPQ8YJHTEXYPE7Q8ZY0.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 19310, FileSize: 19310,
UpdatedAt: time.Now().Add(-48 * time.Hour), UpdatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
}, },
Thumbnail: gtsmodel.Thumbnail{ Thumbnail: gtsmodel.Thumbnail{
Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01FVW7RXPQ8YJHTEXYPE7Q8ZY0.jpeg", Path: "01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01FVW7RXPQ8YJHTEXYPE7Q8ZY0.jpeg",
ContentType: "image/jpeg", ContentType: "image/jpeg",
FileSize: 20395, FileSize: 20395,
UpdatedAt: time.Now().Add(-48 * time.Hour), UpdatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01FVW7RXPQ8YJHTEXYPE7Q8ZY0.jpeg", URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/small/01FVW7RXPQ8YJHTEXYPE7Q8ZY0.jpeg",
RemoteURL: "http://fossbros-anonymous.io/attachments/small/a499f55b-2d1e-4acd-98d2-1ac2ba6d79b9.jpeg", RemoteURL: "http://fossbros-anonymous.io/attachments/small/a499f55b-2d1e-4acd-98d2-1ac2ba6d79b9.jpeg",
}, },
@ -915,8 +915,8 @@ func NewTestEmojis() map[string]*gtsmodel.Emoji {
ID: "01F8MH9H8E4VG3KDYJR9EGPXCQ", ID: "01F8MH9H8E4VG3KDYJR9EGPXCQ",
Shortcode: "rainbow", Shortcode: "rainbow",
Domain: "", Domain: "",
CreatedAt: time.Now(), CreatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
UpdatedAt: time.Now(), UpdatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
ImageRemoteURL: "", ImageRemoteURL: "",
ImageStaticRemoteURL: "", ImageStaticRemoteURL: "",
ImageURL: "http://localhost:8080/fileserver/01F8MH17FWEB39HZJ76B6VXSKF/emoji/original/01F8MH9H8E4VG3KDYJR9EGPXCQ.png", ImageURL: "http://localhost:8080/fileserver/01F8MH17FWEB39HZJ76B6VXSKF/emoji/original/01F8MH9H8E4VG3KDYJR9EGPXCQ.png",
@ -927,7 +927,7 @@ func NewTestEmojis() map[string]*gtsmodel.Emoji {
ImageStaticContentType: "image/png", ImageStaticContentType: "image/png",
ImageFileSize: 36702, ImageFileSize: 36702,
ImageStaticFileSize: 10413, ImageStaticFileSize: 10413,
ImageUpdatedAt: time.Now(), ImageUpdatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
Disabled: false, Disabled: false,
URI: "http://localhost:8080/emoji/01F8MH9H8E4VG3KDYJR9EGPXCQ", URI: "http://localhost:8080/emoji/01F8MH9H8E4VG3KDYJR9EGPXCQ",
VisibleInPicker: true, VisibleInPicker: true,
@ -1128,8 +1128,8 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URI: "http://localhost:8080/users/the_mighty_zork/statuses/01F8MHAYFKS4KMXF8K5Y1C0KRN", URI: "http://localhost:8080/users/the_mighty_zork/statuses/01F8MHAYFKS4KMXF8K5Y1C0KRN",
URL: "http://localhost:8080/@the_mighty_zork/statuses/01F8MHAYFKS4KMXF8K5Y1C0KRN", URL: "http://localhost:8080/@the_mighty_zork/statuses/01F8MHAYFKS4KMXF8K5Y1C0KRN",
Content: "this is an unlocked local-only post that shouldn't federate, but it's still boostable, replyable, and likeable", Content: "this is an unlocked local-only post that shouldn't federate, but it's still boostable, replyable, and likeable",
CreatedAt: time.Now().Add(-46 * time.Hour), CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-46 * time.Hour), UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
Local: true, Local: true,
AccountURI: "http://localhost:8080/users/the_mighty_zork", AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1151,8 +1151,8 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URI: "http://localhost:8080/users/the_mighty_zork/statuses/01F8MHBBN8120SYH7D5S050MGK", URI: "http://localhost:8080/users/the_mighty_zork/statuses/01F8MHBBN8120SYH7D5S050MGK",
URL: "http://localhost:8080/@the_mighty_zork/statuses/01F8MHBBN8120SYH7D5S050MGK", URL: "http://localhost:8080/@the_mighty_zork/statuses/01F8MHBBN8120SYH7D5S050MGK",
Content: "this is a very personal post that I don't want anyone to interact with at all, and i only want mutuals to see it", Content: "this is a very personal post that I don't want anyone to interact with at all, and i only want mutuals to see it",
CreatedAt: time.Now().Add(-45 * time.Hour), CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-45 * time.Hour), UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
Local: true, Local: true,
AccountURI: "http://localhost:8080/users/the_mighty_zork", AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1175,8 +1175,8 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URL: "http://localhost:8080/@the_mighty_zork/statuses/01F8MH82FYRXD2RC6108DAJ5HB", URL: "http://localhost:8080/@the_mighty_zork/statuses/01F8MH82FYRXD2RC6108DAJ5HB",
Content: "here's a little gif of trent", Content: "here's a little gif of trent",
AttachmentIDs: []string{"01F8MH7TDVANYKWVE8VVKFPJTJ"}, AttachmentIDs: []string{"01F8MH7TDVANYKWVE8VVKFPJTJ"},
CreatedAt: time.Now().Add(-1 * time.Hour), CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Hour), UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
Local: true, Local: true,
AccountURI: "http://localhost:8080/users/the_mighty_zork", AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1222,8 +1222,8 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHBQCBTDKN6X5VHGMMN4MA", URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHBQCBTDKN6X5VHGMMN4MA",
URL: "http://localhost:8080/@1happyturtle/statuses/01F8MHBQCBTDKN6X5VHGMMN4MA", URL: "http://localhost:8080/@1happyturtle/statuses/01F8MHBQCBTDKN6X5VHGMMN4MA",
Content: "🐢 hi everyone i post about turtles 🐢", Content: "🐢 hi everyone i post about turtles 🐢",
CreatedAt: time.Now().Add(-189 * time.Hour), CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-189 * time.Hour), UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
Local: true, Local: true,
AccountURI: "http://localhost:8080/users/1happyturtle", AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1245,8 +1245,8 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHC0H0A7XHTVH5F596ZKBM", URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHC0H0A7XHTVH5F596ZKBM",
URL: "http://localhost:8080/@1happyturtle/statuses/01F8MHC0H0A7XHTVH5F596ZKBM", URL: "http://localhost:8080/@1happyturtle/statuses/01F8MHC0H0A7XHTVH5F596ZKBM",
Content: "🐢 this one is federated, likeable, and boostable but not replyable 🐢", Content: "🐢 this one is federated, likeable, and boostable but not replyable 🐢",
CreatedAt: time.Now().Add(-1 * time.Minute), CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Minute), UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
Local: true, Local: true,
AccountURI: "http://localhost:8080/users/1happyturtle", AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1268,8 +1268,8 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHC8VWDRBQR0N1BATDDEM5", URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHC8VWDRBQR0N1BATDDEM5",
URL: "http://localhost:8080/@1happyturtle/statuses/01F8MHC8VWDRBQR0N1BATDDEM5", URL: "http://localhost:8080/@1happyturtle/statuses/01F8MHC8VWDRBQR0N1BATDDEM5",
Content: "🐢 i don't mind people sharing this one but I don't want likes or replies to it because cba🐢", Content: "🐢 i don't mind people sharing this one but I don't want likes or replies to it because cba🐢",
CreatedAt: time.Now().Add(-2 * time.Minute), CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-2 * time.Minute), UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
Local: true, Local: true,
AccountURI: "http://localhost:8080/users/1happyturtle", AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1291,8 +1291,8 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHCP5P2NWYQ416SBA0XSEV", URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHCP5P2NWYQ416SBA0XSEV",
URL: "http://localhost:8080/@1happyturtle/statuses/01F8MHCP5P2NWYQ416SBA0XSEV", URL: "http://localhost:8080/@1happyturtle/statuses/01F8MHCP5P2NWYQ416SBA0XSEV",
Content: "🐢 this is a public status but I want it local only and not boostable 🐢", Content: "🐢 this is a public status but I want it local only and not boostable 🐢",
CreatedAt: time.Now().Add(-1 * time.Minute), CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Minute), UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
Local: true, Local: true,
AccountURI: "http://localhost:8080/users/1happyturtle", AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1315,8 +1315,8 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URI: "http://localhost:8080/users/1happyturtle/statuses/01FCQSQ667XHJ9AV9T27SJJSX5", URI: "http://localhost:8080/users/1happyturtle/statuses/01FCQSQ667XHJ9AV9T27SJJSX5",
URL: "http://localhost:8080/@1happyturtle/statuses/01FCQSQ667XHJ9AV9T27SJJSX5", URL: "http://localhost:8080/@1happyturtle/statuses/01FCQSQ667XHJ9AV9T27SJJSX5",
Content: "🐢 @the_mighty_zork hi zork! 🐢", Content: "🐢 @the_mighty_zork hi zork! 🐢",
CreatedAt: time.Now().Add(-1 * time.Minute), CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Minute), UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
Local: true, Local: true,
AccountURI: "http://localhost:8080/users/1happyturtle", AccountURI: "http://localhost:8080/users/1happyturtle",
MentionIDs: []string{"01FDF2HM2NF6FSRZCDEDV451CN"}, MentionIDs: []string{"01FDF2HM2NF6FSRZCDEDV451CN"},
@ -1341,8 +1341,8 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URI: "http://localhost:8080/users/1happyturtle/statuses/01FN3VJGFH10KR7S2PB0GFJZYG", URI: "http://localhost:8080/users/1happyturtle/statuses/01FN3VJGFH10KR7S2PB0GFJZYG",
URL: "http://localhost:8080/@1happyturtle/statuses/01FN3VJGFH10KR7S2PB0GFJZYG", URL: "http://localhost:8080/@1happyturtle/statuses/01FN3VJGFH10KR7S2PB0GFJZYG",
Content: "🐢 @the_mighty_zork hi zork, this is a direct message, shhhhhh! 🐢", Content: "🐢 @the_mighty_zork hi zork, this is a direct message, shhhhhh! 🐢",
CreatedAt: time.Now().Add(-1 * time.Minute), CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Minute), UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
Local: true, Local: true,
AccountURI: "http://localhost:8080/users/1happyturtle", AccountURI: "http://localhost:8080/users/1happyturtle",
MentionIDs: []string{"01FDF2HM2NF6FSRZCDEDV451CN"}, MentionIDs: []string{"01FDF2HM2NF6FSRZCDEDV451CN"},
@ -1368,8 +1368,8 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URL: "http://localhost:8080/@1happyturtle/statuses/01G20ZM733MGN8J344T4ZDDFY1", URL: "http://localhost:8080/@1happyturtle/statuses/01G20ZM733MGN8J344T4ZDDFY1",
Content: "🐢 hi followers! did u know i'm a turtle? 🐢", Content: "🐢 hi followers! did u know i'm a turtle? 🐢",
AttachmentIDs: []string{}, AttachmentIDs: []string{},
CreatedAt: time.Now().Add(-1 * time.Minute), CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Minute), UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
Local: true, Local: true,
AccountURI: "http://localhost:8080/users/1happyturtle", AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1424,22 +1424,22 @@ func NewTestTags() map[string]*gtsmodel.Tag {
URL: "http://localhost:8080/tags/welcome", URL: "http://localhost:8080/tags/welcome",
Name: "welcome", Name: "welcome",
FirstSeenFromAccountID: "", FirstSeenFromAccountID: "",
CreatedAt: time.Now().Add(-71 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-71 * time.Hour), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
Useable: true, Useable: true,
Listable: true, Listable: true,
LastStatusAt: time.Now().Add(-71 * time.Hour), LastStatusAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
}, },
"Hashtag": { "Hashtag": {
ID: "01FCT9SGYA71487N8D0S1M638G", ID: "01FCT9SGYA71487N8D0S1M638G",
URL: "http://localhost:8080/tags/Hashtag", URL: "http://localhost:8080/tags/Hashtag",
Name: "Hashtag", Name: "Hashtag",
FirstSeenFromAccountID: "", FirstSeenFromAccountID: "",
CreatedAt: time.Now().Add(-71 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-71 * time.Hour), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
Useable: true, Useable: true,
Listable: true, Listable: true,
LastStatusAt: time.Now().Add(-71 * time.Hour), LastStatusAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
}, },
} }
} }
@ -1450,8 +1450,8 @@ func NewTestMentions() map[string]*gtsmodel.Mention {
"zork_mention_foss_satan": { "zork_mention_foss_satan": {
ID: "01FCTA2Y6FGHXQA4ZE6N5NMNEX", ID: "01FCTA2Y6FGHXQA4ZE6N5NMNEX",
StatusID: "01FCTA44PW9H1TB328S9AQXKDS", StatusID: "01FCTA44PW9H1TB328S9AQXKDS",
CreatedAt: time.Now().Add(-1 * time.Minute), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Minute), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
OriginAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", OriginAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
OriginAccountURI: "http://localhost:8080/users/the_mighty_zork", OriginAccountURI: "http://localhost:8080/users/the_mighty_zork",
TargetAccountID: "01F8MH5ZK5VRH73AKHQM6Y9VNX", TargetAccountID: "01F8MH5ZK5VRH73AKHQM6Y9VNX",
@ -1462,8 +1462,8 @@ func NewTestMentions() map[string]*gtsmodel.Mention {
"local_user_2_mention_zork": { "local_user_2_mention_zork": {
ID: "01FDF2HM2NF6FSRZCDEDV451CN", ID: "01FDF2HM2NF6FSRZCDEDV451CN",
StatusID: "01FCQSQ667XHJ9AV9T27SJJSX5", StatusID: "01FCQSQ667XHJ9AV9T27SJJSX5",
CreatedAt: time.Now().Add(-1 * time.Minute), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Minute), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
OriginAccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", OriginAccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
OriginAccountURI: "http://localhost:8080/users/1happyturtle", OriginAccountURI: "http://localhost:8080/users/1happyturtle",
TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1474,8 +1474,8 @@ func NewTestMentions() map[string]*gtsmodel.Mention {
"local_user_2_mention_zork_direct_message": { "local_user_2_mention_zork_direct_message": {
ID: "01FN3VKDEF4CN2W9TKX339BEHB", ID: "01FN3VKDEF4CN2W9TKX339BEHB",
StatusID: "01FN3VJGFH10KR7S2PB0GFJZYG", StatusID: "01FN3VJGFH10KR7S2PB0GFJZYG",
CreatedAt: time.Now().Add(-1 * time.Minute), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Minute), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
OriginAccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", OriginAccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
OriginAccountURI: "http://localhost:8080/users/1happyturtle", OriginAccountURI: "http://localhost:8080/users/1happyturtle",
TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1486,8 +1486,8 @@ func NewTestMentions() map[string]*gtsmodel.Mention {
"admin_account_mention_zork": { "admin_account_mention_zork": {
ID: "01FF26A6BGEKCZFWNEHXB2ZZ6M", ID: "01FF26A6BGEKCZFWNEHXB2ZZ6M",
StatusID: "01FF25D5Q0DH7CHD57CTRS6WK0", StatusID: "01FF25D5Q0DH7CHD57CTRS6WK0",
CreatedAt: time.Now().Add(-46 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-46 * time.Hour), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
OriginAccountID: "01F8MH17FWEB39HZJ76B6VXSKF", OriginAccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
OriginAccountURI: "http://localhost:8080/users/admin", OriginAccountURI: "http://localhost:8080/users/admin",
TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1503,7 +1503,7 @@ func NewTestFaves() map[string]*gtsmodel.StatusFave {
return map[string]*gtsmodel.StatusFave{ return map[string]*gtsmodel.StatusFave{
"local_account_1_admin_account_status_1": { "local_account_1_admin_account_status_1": {
ID: "01F8MHD2QCZSZ6WQS2ATVPEYJ9", ID: "01F8MHD2QCZSZ6WQS2ATVPEYJ9",
CreatedAt: time.Now().Add(-47 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", // local account 1 AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", // local account 1
TargetAccountID: "01F8MH17FWEB39HZJ76B6VXSKF", // admin account TargetAccountID: "01F8MH17FWEB39HZJ76B6VXSKF", // admin account
StatusID: "01F8MH75CBF9JFX4ZAD54N0W0R", // admin account status 1 StatusID: "01F8MH75CBF9JFX4ZAD54N0W0R", // admin account status 1
@ -1511,7 +1511,7 @@ func NewTestFaves() map[string]*gtsmodel.StatusFave {
}, },
"admin_account_local_account_1_status_1": { "admin_account_local_account_1_status_1": {
ID: "01F8Q0486ANTDWKG02A7DS1Q24", ID: "01F8Q0486ANTDWKG02A7DS1Q24",
CreatedAt: time.Now().Add(-46 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
AccountID: "01F8MH17FWEB39HZJ76B6VXSKF", // admin account AccountID: "01F8MH17FWEB39HZJ76B6VXSKF", // admin account
TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", // local account 1 TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", // local account 1
StatusID: "01F8MHAMCHF6Y650WCRSCP4WMY", // local account status 1 StatusID: "01F8MHAMCHF6Y650WCRSCP4WMY", // local account status 1
@ -1526,7 +1526,7 @@ func NewTestNotifications() map[string]*gtsmodel.Notification {
"local_account_1_like": { "local_account_1_like": {
ID: "01F8Q0ANPTWW10DAKTX7BRPBJP", ID: "01F8Q0ANPTWW10DAKTX7BRPBJP",
NotificationType: gtsmodel.NotificationFave, NotificationType: gtsmodel.NotificationFave,
CreatedAt: time.Now().Add(-46 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
OriginAccountID: "01F8MH17FWEB39HZJ76B6VXSKF", OriginAccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
StatusID: "01F8MHAMCHF6Y650WCRSCP4WMY", StatusID: "01F8MHAMCHF6Y650WCRSCP4WMY",
@ -1540,8 +1540,8 @@ func NewTestFollows() map[string]*gtsmodel.Follow {
return map[string]*gtsmodel.Follow{ return map[string]*gtsmodel.Follow{
"local_account_1_admin_account": { "local_account_1_admin_account": {
ID: "01F8PY8RHWRQZV038T4E8T9YK8", ID: "01F8PY8RHWRQZV038T4E8T9YK8",
CreatedAt: time.Now().Add(-46 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-46 * time.Hour), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
TargetAccountID: "01F8MH17FWEB39HZJ76B6VXSKF", TargetAccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
ShowReblogs: true, ShowReblogs: true,
@ -1550,8 +1550,8 @@ func NewTestFollows() map[string]*gtsmodel.Follow {
}, },
"local_account_1_local_account_2": { "local_account_1_local_account_2": {
ID: "01F8PYDCE8XE23GRE5DPZJDZDP", ID: "01F8PYDCE8XE23GRE5DPZJDZDP",
CreatedAt: time.Now().Add(-1 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Hour), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
TargetAccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", TargetAccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
ShowReblogs: true, ShowReblogs: true,
@ -1560,8 +1560,8 @@ func NewTestFollows() map[string]*gtsmodel.Follow {
}, },
"local_account_2_local_account_1": { "local_account_2_local_account_1": {
ID: "01G1TK1RS4K3E0MSFTXBFWAH9Q", ID: "01G1TK1RS4K3E0MSFTXBFWAH9Q",
CreatedAt: time.Now().Add(-1 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Hour), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
ShowReblogs: true, ShowReblogs: true,
@ -1570,8 +1570,8 @@ func NewTestFollows() map[string]*gtsmodel.Follow {
}, },
"admin_account_local_account_1": { "admin_account_local_account_1": {
ID: "01G1TK3PQKFW1BQZ9WVYRTFECK", ID: "01G1TK3PQKFW1BQZ9WVYRTFECK",
CreatedAt: time.Now().Add(-46 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-46 * time.Hour), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
AccountID: "01F8MH17FWEB39HZJ76B6VXSKF", AccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF", TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
ShowReblogs: true, ShowReblogs: true,
@ -1585,8 +1585,8 @@ func NewTestBlocks() map[string]*gtsmodel.Block {
return map[string]*gtsmodel.Block{ return map[string]*gtsmodel.Block{
"local_account_2_block_remote_account_1": { "local_account_2_block_remote_account_1": {
ID: "01FEXXET6XXMF7G2V3ASZP3YQW", ID: "01FEXXET6XXMF7G2V3ASZP3YQW",
CreatedAt: time.Now().Add(-1 * time.Hour), CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: time.Now().Add(-1 * time.Hour), UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
URI: "http://localhost:8080/users/1happyturtle/blocks/01FEXXET6XXMF7G2V3ASZP3YQW", URI: "http://localhost:8080/users/1happyturtle/blocks/01FEXXET6XXMF7G2V3ASZP3YQW",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF", AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
TargetAccountID: "01F8MH5ZK5VRH73AKHQM6Y9VNX", TargetAccountID: "01F8MH5ZK5VRH73AKHQM6Y9VNX",
@ -1609,7 +1609,7 @@ func NewTestActivities(accounts map[string]*gtsmodel.Account) map[string]Activit
dmForZork := NewAPNote( dmForZork := NewAPNote(
URLMustParse("http://fossbros-anonymous.io/users/foss_satan/statuses/5424b153-4553-4f30-9358-7b92f7cd42f6"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan/statuses/5424b153-4553-4f30-9358-7b92f7cd42f6"),
URLMustParse("http://fossbros-anonymous.io/@foss_satan/5424b153-4553-4f30-9358-7b92f7cd42f6"), URLMustParse("http://fossbros-anonymous.io/@foss_satan/5424b153-4553-4f30-9358-7b92f7cd42f6"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
"hey zork here's a new private note for you", "hey zork here's a new private note for you",
"new note for zork", "new note for zork",
URLMustParse("http://fossbros-anonymous.io/users/foss_satan"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan"),
@ -1622,14 +1622,14 @@ func NewTestActivities(accounts map[string]*gtsmodel.Account) map[string]Activit
createDmForZork := WrapAPNoteInCreate( createDmForZork := WrapAPNoteInCreate(
URLMustParse("http://fossbros-anonymous.io/users/foss_satan/statuses/5424b153-4553-4f30-9358-7b92f7cd42f6/activity"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan/statuses/5424b153-4553-4f30-9358-7b92f7cd42f6/activity"),
URLMustParse("http://fossbros-anonymous.io/users/foss_satan"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
dmForZork) dmForZork)
createDmForZorkSig, createDmForZorkDigest, creatDmForZorkDate := GetSignatureForActivity(createDmForZork, accounts["remote_account_1"].PublicKeyURI, accounts["remote_account_1"].PrivateKey, URLMustParse(accounts["local_account_1"].InboxURI)) createDmForZorkSig, createDmForZorkDigest, creatDmForZorkDate := GetSignatureForActivity(createDmForZork, accounts["remote_account_1"].PublicKeyURI, accounts["remote_account_1"].PrivateKey, URLMustParse(accounts["local_account_1"].InboxURI))
replyToTurtle := NewAPNote( replyToTurtle := NewAPNote(
URLMustParse("http://fossbros-anonymous.io/users/foss_satan/statuses/2f1195a6-5cb0-4475-adf5-92ab9a0147fe"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan/statuses/2f1195a6-5cb0-4475-adf5-92ab9a0147fe"),
URLMustParse("http://fossbros-anonymous.io/@foss_satan/2f1195a6-5cb0-4475-adf5-92ab9a0147fe"), URLMustParse("http://fossbros-anonymous.io/@foss_satan/2f1195a6-5cb0-4475-adf5-92ab9a0147fe"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
"@1happyturtle@localhost:8080 u suck lol", "@1happyturtle@localhost:8080 u suck lol",
"", "",
URLMustParse("http://fossbros-anonymous.io/users/foss_satan"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan"),
@ -1645,7 +1645,7 @@ func NewTestActivities(accounts map[string]*gtsmodel.Account) map[string]Activit
createReplyToTurtle := WrapAPNoteInCreate( createReplyToTurtle := WrapAPNoteInCreate(
URLMustParse("http://fossbros-anonymous.io/users/foss_satan/statuses/2f1195a6-5cb0-4475-adf5-92ab9a0147fe"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan/statuses/2f1195a6-5cb0-4475-adf5-92ab9a0147fe"),
URLMustParse("http://fossbros-anonymous.io/users/foss_satan"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
replyToTurtle) replyToTurtle)
createReplyToTurtleForZorkSig, createReplyToTurtleForZorkDigest, createReplyToTurtleForZorkDate := GetSignatureForActivity(createReplyToTurtle, accounts["remote_account_1"].PublicKeyURI, accounts["remote_account_1"].PrivateKey, URLMustParse(accounts["local_account_1"].InboxURI)) createReplyToTurtleForZorkSig, createReplyToTurtleForZorkDigest, createReplyToTurtleForZorkDate := GetSignatureForActivity(createReplyToTurtle, accounts["remote_account_1"].PublicKeyURI, accounts["remote_account_1"].PrivateKey, URLMustParse(accounts["local_account_1"].InboxURI))
createReplyToTurtleForTurtleSig, createReplyToTurtleForTurtleDigest, createReplyToTurtleForTurtleDate := GetSignatureForActivity(createReplyToTurtle, accounts["remote_account_1"].PublicKeyURI, accounts["remote_account_1"].PrivateKey, URLMustParse(accounts["local_account_2"].InboxURI)) createReplyToTurtleForTurtleSig, createReplyToTurtleForTurtleDigest, createReplyToTurtleForTurtleDate := GetSignatureForActivity(createReplyToTurtle, accounts["remote_account_1"].PublicKeyURI, accounts["remote_account_1"].PrivateKey, URLMustParse(accounts["local_account_2"].InboxURI))
@ -1653,7 +1653,7 @@ func NewTestActivities(accounts map[string]*gtsmodel.Account) map[string]Activit
forwardedMessage := NewAPNote( forwardedMessage := NewAPNote(
URLMustParse("http://example.org/users/some_user/statuses/afaba698-5740-4e32-a702-af61aa543bc1"), URLMustParse("http://example.org/users/some_user/statuses/afaba698-5740-4e32-a702-af61aa543bc1"),
URLMustParse("http://example.org/@some_user/afaba698-5740-4e32-a702-af61aa543bc1"), URLMustParse("http://example.org/@some_user/afaba698-5740-4e32-a702-af61aa543bc1"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
"this is a public status, please forward it!", "this is a public status, please forward it!",
"", "",
URLMustParse("http://example.org/users/some_user"), URLMustParse("http://example.org/users/some_user"),
@ -1672,14 +1672,14 @@ func NewTestActivities(accounts map[string]*gtsmodel.Account) map[string]Activit
createForwardedMessage := WrapAPNoteInCreate( createForwardedMessage := WrapAPNoteInCreate(
URLMustParse("http://example.org/users/some_user/statuses/afaba698-5740-4e32-a702-af61aa543bc1/activity"), URLMustParse("http://example.org/users/some_user/statuses/afaba698-5740-4e32-a702-af61aa543bc1/activity"),
URLMustParse("http://example.org/users/some_user"), URLMustParse("http://example.org/users/some_user"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
forwardedMessage) forwardedMessage)
createForwardedMessageSig, createForwardedMessageDigest, createForwardedMessageDate := GetSignatureForActivity(createForwardedMessage, accounts["remote_account_1"].PublicKeyURI, accounts["remote_account_1"].PrivateKey, URLMustParse(accounts["local_account_1"].InboxURI)) createForwardedMessageSig, createForwardedMessageDigest, createForwardedMessageDate := GetSignatureForActivity(createForwardedMessage, accounts["remote_account_1"].PublicKeyURI, accounts["remote_account_1"].PrivateKey, URLMustParse(accounts["local_account_1"].InboxURI))
announceForwarded1Zork := newAPAnnounce( announceForwarded1Zork := newAPAnnounce(
URLMustParse("http://fossbros-anonymous.io/users/foss_satan/first_announce"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan/first_announce"),
URLMustParse("http://fossbros-anonymous.io/users/foss_satan"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
URLMustParse("http://fossbros-anonymous.io/users/foss_satan/followers"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan/followers"),
forwardedMessage, forwardedMessage,
) )
@ -1688,7 +1688,7 @@ func NewTestActivities(accounts map[string]*gtsmodel.Account) map[string]Activit
announceForwarded1Turtle := newAPAnnounce( announceForwarded1Turtle := newAPAnnounce(
URLMustParse("http://fossbros-anonymous.io/users/foss_satan/first_announce"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan/first_announce"),
URLMustParse("http://fossbros-anonymous.io/users/foss_satan"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
URLMustParse("http://fossbros-anonymous.io/users/foss_satan/followers"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan/followers"),
forwardedMessage, forwardedMessage,
) )
@ -1697,7 +1697,7 @@ func NewTestActivities(accounts map[string]*gtsmodel.Account) map[string]Activit
announceForwarded2Zork := newAPAnnounce( announceForwarded2Zork := newAPAnnounce(
URLMustParse("http://fossbros-anonymous.io/users/foss_satan/second_announce"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan/second_announce"),
URLMustParse("http://fossbros-anonymous.io/users/foss_satan"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
URLMustParse("http://fossbros-anonymous.io/users/foss_satan/followers"), URLMustParse("http://fossbros-anonymous.io/users/foss_satan/followers"),
forwardedMessage, forwardedMessage,
) )
@ -1912,7 +1912,7 @@ func NewTestFediStatuses() map[string]vocab.ActivityStreamsNote {
"http://example.org/users/some_user/statuses/afaba698-5740-4e32-a702-af61aa543bc1": NewAPNote( "http://example.org/users/some_user/statuses/afaba698-5740-4e32-a702-af61aa543bc1": NewAPNote(
URLMustParse("http://example.org/users/some_user/statuses/afaba698-5740-4e32-a702-af61aa543bc1"), URLMustParse("http://example.org/users/some_user/statuses/afaba698-5740-4e32-a702-af61aa543bc1"),
URLMustParse("http://example.org/@some_user/afaba698-5740-4e32-a702-af61aa543bc1"), URLMustParse("http://example.org/@some_user/afaba698-5740-4e32-a702-af61aa543bc1"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
"this is a public status, please forward it!", "this is a public status, please forward it!",
"", "",
URLMustParse("http://example.org/users/some_user"), URLMustParse("http://example.org/users/some_user"),
@ -1931,7 +1931,7 @@ func NewTestFediStatuses() map[string]vocab.ActivityStreamsNote {
"https://unknown-instance.com/users/brand_new_person/statuses/01FE4NTHKWW7THT67EF10EB839": NewAPNote( "https://unknown-instance.com/users/brand_new_person/statuses/01FE4NTHKWW7THT67EF10EB839": NewAPNote(
URLMustParse("https://unknown-instance.com/users/brand_new_person/statuses/01FE4NTHKWW7THT67EF10EB839"), URLMustParse("https://unknown-instance.com/users/brand_new_person/statuses/01FE4NTHKWW7THT67EF10EB839"),
URLMustParse("https://unknown-instance.com/users/@brand_new_person/01FE4NTHKWW7THT67EF10EB839"), URLMustParse("https://unknown-instance.com/users/@brand_new_person/01FE4NTHKWW7THT67EF10EB839"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
"Hello world!", "Hello world!",
"", "",
URLMustParse("https://unknown-instance.com/users/brand_new_person"), URLMustParse("https://unknown-instance.com/users/brand_new_person"),
@ -1946,7 +1946,7 @@ func NewTestFediStatuses() map[string]vocab.ActivityStreamsNote {
"https://unknown-instance.com/users/brand_new_person/statuses/01FE5Y30E3W4P7TRE0R98KAYQV": NewAPNote( "https://unknown-instance.com/users/brand_new_person/statuses/01FE5Y30E3W4P7TRE0R98KAYQV": NewAPNote(
URLMustParse("https://unknown-instance.com/users/brand_new_person/statuses/01FE5Y30E3W4P7TRE0R98KAYQV"), URLMustParse("https://unknown-instance.com/users/brand_new_person/statuses/01FE5Y30E3W4P7TRE0R98KAYQV"),
URLMustParse("https://unknown-instance.com/users/@brand_new_person/01FE5Y30E3W4P7TRE0R98KAYQV"), URLMustParse("https://unknown-instance.com/users/@brand_new_person/01FE5Y30E3W4P7TRE0R98KAYQV"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
"Hey @the_mighty_zork@localhost:8080 how's it going?", "Hey @the_mighty_zork@localhost:8080 how's it going?",
"", "",
URLMustParse("https://unknown-instance.com/users/brand_new_person"), URLMustParse("https://unknown-instance.com/users/brand_new_person"),
@ -1966,7 +1966,7 @@ func NewTestFediStatuses() map[string]vocab.ActivityStreamsNote {
"https://turnip.farm/users/turniplover6969/statuses/70c53e54-3146-42d5-a630-83c8b6c7c042": NewAPNote( "https://turnip.farm/users/turniplover6969/statuses/70c53e54-3146-42d5-a630-83c8b6c7c042": NewAPNote(
URLMustParse("https://turnip.farm/users/turniplover6969/statuses/70c53e54-3146-42d5-a630-83c8b6c7c042"), URLMustParse("https://turnip.farm/users/turniplover6969/statuses/70c53e54-3146-42d5-a630-83c8b6c7c042"),
URLMustParse("https://turnip.farm/@turniplover6969/70c53e54-3146-42d5-a630-83c8b6c7c042"), URLMustParse("https://turnip.farm/@turniplover6969/70c53e54-3146-42d5-a630-83c8b6c7c042"),
time.Now(), TimeMustParse("2022-07-13T12:13:12+02:00"),
"", "",
"", "",
URLMustParse("https://turnip.farm/users/turniplover6969"), URLMustParse("https://turnip.farm/users/turniplover6969"),
@ -2785,9 +2785,6 @@ func NewAPNote(
note.SetActivityStreamsUrl(url) note.SetActivityStreamsUrl(url)
} }
if noteCreatedAt.IsZero() {
noteCreatedAt = time.Now()
}
published := streams.NewActivityStreamsPublishedProperty() published := streams.NewActivityStreamsPublishedProperty()
published.Set(noteCreatedAt) published.Set(noteCreatedAt)
note.SetActivityStreamsPublished(published) note.SetActivityStreamsPublished(published)

View file

@ -1,24 +1,24 @@
/* /*
GoToSocial GoToSocial
Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* /*
This stylesheets defines (color) variables to be used by other stylesheets on the page This stylesheets defines (color) variables to be used by other stylesheets on the page
postcss-custom-prop-vars will transpile these to css --variables postcss-custom-prop-vars will transpile these to css --variables
*/ */
$bg: #525c66; $bg: #525c66;

View file

@ -1,21 +1,24 @@
/* /*
GoToSocial GoToSocial
Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
$br: 0.4rem;
$boxshadow: 0 0.4rem 1rem -0.2rem rgba(0,0,0,0.2);
html, body { html, body {
padding: 0; padding: 0;
margin: 0; margin: 0;
@ -197,16 +200,16 @@ section.error {
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
span { span {
font-size: 2em; font-size: 2em;
} }
pre { pre {
border: 1px solid #ff000080; border: 1px solid #ff000080;
margin-left: 1em; margin-left: 1em;
padding: 0 0.7em; padding: 0 0.7em;
border-radius: 0.5em; border-radius: 0.5em;
background-color: #ff000010; background-color: #ff000010;
font-size: 1.3em; font-size: 1.3em;
white-space: pre-wrap; white-space: pre-wrap;
} }
} }

View file

@ -1,131 +1,143 @@
/* /*
GoToSocial GoToSocial
Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
main { main {
background: transparent; background: transparent;
} padding-top: 0;
.headerimage {
img {
width: 100%;
height: 15em;
object-fit: cover;
border-radius: 10px;
}
} }
.profile { .profile {
position: relative; position: relative;
background: $bg_darker3; background: $bg_darker3;
padding: 2rem; display: grid;
display: flex; grid-template-rows: minmax(6rem, 20%) auto auto;
flex-wrap: wrap; grid-template-columns: 1fr;
justify-content: space-around; flex-wrap: wrap;
gap: 0.5rem; justify-content: space-around;
margin-bottom: 0.2rem; gap: 0.5rem;
margin-bottom: 0.2rem;
border-radius: $br;
.basic { box-shadow: $boxshadow;
display: flex;
flex-direction: column;
flex: 1 1 25em;
gap: 0.5rem;
a { .headerimage {
position: relative; height: 100%;
z-index: 1; aspect-ratio: 3 / 1;
color: inherit; overflow: hidden;
text-decoration: none; box-shadow: $boxshadow;
}
.avatar-container { img {
position: relative; width: 100%;
width: 100%; height: 100%;
max-width: 25em; object-fit: cover;
border-radius: $br $br 0 0;
}
}
.avatar { .basic {
position: absolute; margin-top: -7rem;
top: 0; padding: 0 1rem;
left: 0;
bottom: 0;
right: 0;
img { display: grid;
object-fit: cover; grid-template-columns: auto 1fr;
border-radius: 10px; grid-template-rows: 6.5rem auto;
width: 100%;
height: 100%;
}
}
}
.avatar-container:before { .avatar {
content: ""; box-sizing: border-box;
float: left; height: 8.5rem;
padding-top: 100%; width: 8.5rem;
} grid-row: 1 / span 2;
background: $bg;
border: 0.2rem solid $acc2;
padding: 0;
border-radius: $br;
position: relative;
box-shadow: $boxshadow;
img {
object-fit: cover;
border-radius: $br;
width: 100%;
height: 100%;
}
}
.displayname { a {
font-weight: bold; position: relative;
font-size: 1.6rem; z-index: 1;
align-self: start; color: inherit;
} text-decoration: none;
} padding: 0.5rem;
}
.detailed { .displayname {
display: flex; align-self: end;
flex-direction: column; font-weight: bold;
flex: 1 1 25em; font-size: 2rem;
line-height: 2.2rem;
}
h2 { .username {
margin-top: 0; padding-top: 0.25rem;
} color: $acc1;
font-weight: bold;
}
}
.bio { .detailed {
margin: 0; padding: 0 1rem;
display: flex;
flex-direction: column;
flex: 1 1 25em;
a { h2 {
color: $acc1; margin-top: 0;
text-decoration: underline; }
}
} .bio {
} margin: 0;
a {
color: $acc1;
text-decoration: underline;
}
}
}
} }
.accountstats { .accountstats {
position: relative; background: $bg_lighter3;
background: $bg_darker3; display: flex;
padding: 0.5rem; flex-wrap: wrap;
display: flex; justify-content: space-between;
flex-wrap: wrap; padding: 0 1.2rem;
justify-content: space-evenly; border-radius: 0 0 $br $br;
gap: 0.5rem;
margin-bottom: 0.2rem;
.entry { .entry {
background: $bg_lighter3; padding: 1rem 0;
padding: 0.5rem; text-align: center;
flex-grow: 1; }
text-align: center;
}
} }
footer + div { .toot, .toot:last-child {
/* something weird from the devstack.. */ box-shadow: $boxshadow;
display: none;
} }
#recent {
margin-left: 1rem;
}

View file

@ -1,19 +1,19 @@
/* /*
GoToSocial GoToSocial
Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org Copyright (C) 2021-2022 GoToSocial Authors admin@gotosocial.org
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details. GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
main { main {
@ -24,17 +24,20 @@ main {
.thread { .thread {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border-radius: $br;
background: $bg_darker5;
box-shadow: $boxshadow;
} }
.toot { .toot {
position: relative; position: relative;
background: $bg_darker3; background: $bg_darker3;
padding: 2rem; padding: 1.5rem;
/* padding-bottom: 0; */
display: grid; display: grid;
grid-template-columns: 3.2rem auto 1fr; grid-template-columns: 4rem auto 1fr;
column-gap: 0.5rem; column-gap: 0.5rem;
margin-bottom: 0.2rem; margin-bottom: $br;
border-radius: $br;
a { a {
position: relative; position: relative;
@ -45,11 +48,16 @@ main {
.avatar { .avatar {
grid-row: span 2; grid-row: span 2;
aspect-ratio: 1/1;
img { img {
height: 3.2rem; height: 100%;
width: 3.2rem; width: 100%;
object-fit: cover; object-fit: cover;
background: $bg;
border: 0.1rem solid $acc2;
/* box-sizing: border-box; */
border-radius: calc($br / 1.5);
} }
} }
@ -78,6 +86,9 @@ main {
z-index: 2; z-index: 2;
cursor: pointer; cursor: pointer;
} }
label:hover {
background: $acc2;
}
} }
.text { .text {
@ -203,16 +214,16 @@ main {
z-index: 0; z-index: 0;
} }
$border-radius: 0.3rem;
&:first-child { &:first-child {
/* top left, top right */ /* top left, top right */
border-radius: $border-radius $border-radius 0 0; border-radius: $br $br 0 0;
} }
&:last-child { &:last-child {
/* bottom left, bottom right */ /* bottom left, bottom right */
border-radius: 0 0 $border-radius $border-radius; border-radius: 0 0 $br $br;
padding-bottom: 1.5rem; padding-bottom: 1.5rem;
margin-bottom: 0;
} }
&.expanded { &.expanded {

View file

@ -149,7 +149,7 @@ module.exports = function oauthClient(config, initState) {
return (state.access_token != undefined); return (state.access_token != undefined);
} }
function apiRequest(path, method, data, type="json") { function apiRequest(path, method, data, type="json", accept="json") {
if (!isAuthorized()) { if (!isAuthorized()) {
throw new Error("Not Authenticated"); throw new Error("Not Authenticated");
} }
@ -160,7 +160,8 @@ module.exports = function oauthClient(config, initState) {
url.search = s; url.search = s;
} }
let headers = { let headers = {
"Authorization": `Bearer ${state.access_token}` "Authorization": `Bearer ${state.access_token}`,
"Accept": accept == "json" ? "application/json" : "*/*"
}; };
let body = data; let body = data;
if (type == "json" && body != undefined) { if (type == "json" && body != undefined) {

File diff suppressed because it is too large Load diff

View file

@ -18,7 +18,7 @@
</head> </head>
<body> <body>
<div class="page"> <div class="page">
<a href="/" class="nounderline"> <a aria-label="instance homepage" href="/" class="nounderline header">
<header> <header>
<img src="/assets/logo.png" alt="Instance Logo"/> <img src="/assets/logo.png" alt="Instance Logo"/>
<div> <div>

View file

@ -1,28 +1,32 @@
{{ template "header.tmpl" .}} {{ template "header.tmpl" .}}
<main> <main>
{{ if .account.Header }}<a href="{{.account.Header}}" class="headerimage"><img src="{{.account.Header}}"></a>{{ end }}
<div class="profile"> <div class="profile">
<div class="headerimage">
{{ if .account.Header }}
<img
src="{{.account.Header}}"
alt="{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}'s header"
/>
{{ end }}
</div>
<div class="basic"> <div class="basic">
<a href="{{.account.Avatar}}" class="avatar"><img src="{{.account.Avatar}}" alt="{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}'s avatar"></a>
<a href="{{.account.URL}}" class="displayname">{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}</a> <a href="{{.account.URL}}" class="displayname">{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}</a>
<a href="{{.account.URL}}" class="username">@{{.account.Username}}</a> <a href="{{.account.URL}}" class="username">@{{.account.Username}}</a>
<div class="avatar-container">
<a href="{{.account.Avatar}}" class="avatar"><img src="{{.account.Avatar}}"></a>
</div>
</div> </div>
<div class="detailed"> <div class="detailed">
<h2>About @{{.account.Username}}</h2>
<div class="bio"> <div class="bio">
{{ if .account.Note }}{{ .account.Note | noescape }}{{else}}This GoToSocial user hasn't written a bio yet!{{end}} {{ if .account.Note }}{{ .account.Note | noescape }}{{else}}This GoToSocial user hasn't written a bio yet!{{end}}
</div> </div>
</div> </div>
<div class="accountstats">
<div class="entry">Joined <b>{{.account.CreatedAt | timestampShort}}</b></div>
<div class="entry">Followed by <b>{{.account.FollowersCount}}</b></div>
<div class="entry">Following <b>{{.account.FollowingCount}}</b></div>
<div class="entry">Posted <b>{{.account.StatusesCount}}</b></div>
</div>
</div> </div>
<div class="accountstats"> <h2 id="recent">Recent public toots</h2>
<div class="entry">Joined {{.account.CreatedAt | timestampShort}}</div>
<div class="entry">Followed by {{.account.FollowersCount}}</div>
<div class="entry">Following {{.account.FollowingCount}}</div>
<div class="entry">Posted {{.account.StatusesCount}}</div>
</div>
<h2>Recent public posts by @{{.account.Username}}</h2>
<div class="thread"> <div class="thread">
{{range .statuses}} {{range .statuses}}
<div class="toot expanded"> <div class="toot expanded">

View file

@ -1,4 +1,4 @@
<a href="{{.Account.URL}}" class="avatar"><img src="{{.Account.Avatar}}"></a> <a href="{{.Account.URL}}" class="avatar"><img src="{{.Account.Avatar}}" alt=""></a>
<a href="{{.Account.URL}}" class="displayname">{{if .Account.DisplayName}}{{.Account.DisplayName}}{{else}}{{.Account.Username}}{{end}}</a> <a href="{{.Account.URL}}" class="displayname">{{if .Account.DisplayName}}{{.Account.DisplayName}}{{else}}{{.Account.Username}}{{end}}</a>
<a href="{{.Account.URL}}" class="username">@{{.Account.Username}}</a> <a href="{{.Account.URL}}" class="username">@{{.Account.Username}}</a>
<div class="text"> <div class="text">