summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-07-20 15:02:22 +0200
committerLibravatar GitHub <noreply@github.com>2024-07-20 14:02:22 +0100
commitad700c5029688ffabae568c23bedd7bb333f7f33 (patch)
tree189e5657eb53722df004cd94727b0518bd9b4ef2 /internal
parent[feature] use webp for thumbnails (#3116) (diff)
downloadgotosocial-ad700c5029688ffabae568c23bedd7bb333f7f33.tar.xz
[chore/frontend] Use smaller webp images for logo and default avatars (#3119)
Diffstat (limited to 'internal')
-rw-r--r--internal/api/client/accounts/profile_test.go4
-rw-r--r--internal/api/client/admin/accountsgetv2_test.go32
-rw-r--r--internal/api/client/admin/reportsget_test.go52
-rw-r--r--internal/api/client/followrequests/get_test.go4
-rw-r--r--internal/api/client/instance/instancepatch_test.go34
-rw-r--r--internal/api/client/mutes/mutesget_test.go2
-rw-r--r--internal/api/client/reports/reportget_test.go4
-rw-r--r--internal/api/client/reports/reportsget_test.go16
-rw-r--r--internal/processing/stream/notification_test.go4
-rw-r--r--internal/processing/stream/statusupdate_test.go4
-rw-r--r--internal/typeutils/defaulticons.go4
-rw-r--r--internal/typeutils/internaltofrontend.go4
-rw-r--r--internal/typeutils/internaltofrontend_test.go100
13 files changed, 132 insertions, 132 deletions
diff --git a/internal/api/client/accounts/profile_test.go b/internal/api/client/accounts/profile_test.go
index 62a622b37..f6d97c014 100644
--- a/internal/api/client/accounts/profile_test.go
+++ b/internal/api/client/accounts/profile_test.go
@@ -119,7 +119,7 @@ func (suite *AccountProfileTestSuite) TestDeleteHeader() {
http.StatusOK,
)
if suite.NoError(err) {
- suite.Equal("http://localhost:8080/assets/default_header.png", account.Header)
+ suite.Equal("http://localhost:8080/assets/default_header.webp", account.Header)
}
}
@@ -132,7 +132,7 @@ func (suite *AccountProfileTestSuite) TestDeleteNonexistentHeader() {
http.StatusOK,
)
if suite.NoError(err) {
- suite.Equal("http://localhost:8080/assets/default_header.png", account.Header)
+ suite.Equal("http://localhost:8080/assets/default_header.webp", account.Header)
}
}
diff --git a/internal/api/client/admin/accountsgetv2_test.go b/internal/api/client/admin/accountsgetv2_test.go
index acf12fd31..15eb8534b 100644
--- a/internal/api/client/admin/accountsgetv2_test.go
+++ b/internal/api/client/admin/accountsgetv2_test.go
@@ -90,8 +90,8 @@ func (suite *AccountsGetTestSuite) TestAccountsGetFromTop() {
"url": "http://localhost:8080/@1happyturtle",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 8,
@@ -147,8 +147,8 @@ func (suite *AccountsGetTestSuite) TestAccountsGetFromTop() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -193,8 +193,8 @@ func (suite *AccountsGetTestSuite) TestAccountsGetFromTop() {
"url": "http://localhost:8080/@localhost:8080",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 0,
@@ -282,8 +282,8 @@ func (suite *AccountsGetTestSuite) TestAccountsGetFromTop() {
"url": "http://localhost:8080/@weed_lord420",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 0,
@@ -327,8 +327,8 @@ func (suite *AccountsGetTestSuite) TestAccountsGetFromTop() {
"url": "http://example.org/@Some_User",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 1,
@@ -368,8 +368,8 @@ func (suite *AccountsGetTestSuite) TestAccountsGetFromTop() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -451,8 +451,8 @@ func (suite *AccountsGetTestSuite) TestAccountsGetFromTop() {
"url": "https://xn--xample-ova.org/users/@%C3%BCser",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 0,
@@ -531,8 +531,8 @@ func (suite *AccountsGetTestSuite) TestAccountsMinID() {
"url": "http://localhost:8080/@localhost:8080",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 0,
diff --git a/internal/api/client/admin/reportsget_test.go b/internal/api/client/admin/reportsget_test.go
index ea5375314..ebcd799f8 100644
--- a/internal/api/client/admin/reportsget_test.go
+++ b/internal/api/client/admin/reportsget_test.go
@@ -177,8 +177,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -218,8 +218,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {
"url": "http://localhost:8080/@1happyturtle",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 8,
@@ -275,8 +275,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -321,8 +321,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -380,8 +380,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {
"url": "http://localhost:8080/@1happyturtle",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 8,
@@ -437,8 +437,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -484,8 +484,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -622,8 +622,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetCreatedByAccount() {
"url": "http://localhost:8080/@1happyturtle",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 8,
@@ -679,8 +679,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetCreatedByAccount() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -726,8 +726,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetCreatedByAccount() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -864,8 +864,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetTargetAccount() {
"url": "http://localhost:8080/@1happyturtle",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 8,
@@ -921,8 +921,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetTargetAccount() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -968,8 +968,8 @@ func (suite *ReportsGetTestSuite) TestReportsGetTargetAccount() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
diff --git a/internal/api/client/followrequests/get_test.go b/internal/api/client/followrequests/get_test.go
index 35e4488c3..b9b6db7c6 100644
--- a/internal/api/client/followrequests/get_test.go
+++ b/internal/api/client/followrequests/get_test.go
@@ -95,8 +95,8 @@ func (suite *GetTestSuite) TestGet() {
"url": "http://example.org/@Some_User",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 1,
diff --git a/internal/api/client/instance/instancepatch_test.go b/internal/api/client/instance/instancepatch_test.go
index 65a10d192..ba0d026f3 100644
--- a/internal/api/client/instance/instancepatch_test.go
+++ b/internal/api/client/instance/instancepatch_test.go
@@ -151,7 +151,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch1() {
"status_count": 20,
"user_count": 4
},
- "thumbnail": "http://localhost:8080/assets/logo.png",
+ "thumbnail": "http://localhost:8080/assets/logo.webp",
"contact_account": {
"id": "01F8MH17FWEB39HZJ76B6VXSKF",
"username": "admin",
@@ -165,8 +165,8 @@ func (suite *InstancePatchTestSuite) TestInstancePatch1() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -285,7 +285,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch2() {
"status_count": 20,
"user_count": 4
},
- "thumbnail": "http://localhost:8080/assets/logo.png",
+ "thumbnail": "http://localhost:8080/assets/logo.webp",
"contact_account": {
"id": "01F8MH17FWEB39HZJ76B6VXSKF",
"username": "admin",
@@ -299,8 +299,8 @@ func (suite *InstancePatchTestSuite) TestInstancePatch2() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -419,7 +419,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch3() {
"status_count": 20,
"user_count": 4
},
- "thumbnail": "http://localhost:8080/assets/logo.png",
+ "thumbnail": "http://localhost:8080/assets/logo.webp",
"contact_account": {
"id": "01F8MH17FWEB39HZJ76B6VXSKF",
"username": "admin",
@@ -433,8 +433,8 @@ func (suite *InstancePatchTestSuite) TestInstancePatch3() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -604,7 +604,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch6() {
"status_count": 20,
"user_count": 4
},
- "thumbnail": "http://localhost:8080/assets/logo.png",
+ "thumbnail": "http://localhost:8080/assets/logo.webp",
"contact_account": {
"id": "01F8MH17FWEB39HZJ76B6VXSKF",
"username": "admin",
@@ -618,8 +618,8 @@ func (suite *InstancePatchTestSuite) TestInstancePatch6() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -776,8 +776,8 @@ func (suite *InstancePatchTestSuite) TestInstancePatch8() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -931,7 +931,7 @@ func (suite *InstancePatchTestSuite) TestInstancePatch9() {
"status_count": 20,
"user_count": 4
},
- "thumbnail": "http://localhost:8080/assets/logo.png",
+ "thumbnail": "http://localhost:8080/assets/logo.webp",
"contact_account": {
"id": "01F8MH17FWEB39HZJ76B6VXSKF",
"username": "admin",
@@ -945,8 +945,8 @@ func (suite *InstancePatchTestSuite) TestInstancePatch9() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
diff --git a/internal/api/client/mutes/mutesget_test.go b/internal/api/client/mutes/mutesget_test.go
index 2e5a00c6a..9939174a0 100644
--- a/internal/api/client/mutes/mutesget_test.go
+++ b/internal/api/client/mutes/mutesget_test.go
@@ -148,7 +148,7 @@ func (suite *MutesTestSuite) TestIndefinitelyMutedAccountSerializesMuteExpiratio
// Fetch all muted accounts for the logged-in account.
// The expected body contains `"mute_expires_at":null`.
- _, err = suite.getMutedAccounts(http.StatusOK, `[{"id":"01F8MH5ZK5VRH73AKHQM6Y9VNX","username":"foss_satan","acct":"foss_satan@fossbros-anonymous.io","display_name":"big gerald","locked":false,"discoverable":true,"bot":false,"created_at":"2021-09-26T10:52:36.000Z","note":"i post about like, i dunno, stuff, or whatever!!!!","url":"http://fossbros-anonymous.io/@foss_satan","avatar":"","avatar_static":"","header":"http://localhost:8080/assets/default_header.png","header_static":"http://localhost:8080/assets/default_header.png","followers_count":0,"following_count":0,"statuses_count":3,"last_status_at":"2021-09-11T09:40:37.000Z","emojis":[],"fields":[],"mute_expires_at":null}]`)
+ _, err = suite.getMutedAccounts(http.StatusOK, `[{"id":"01F8MH5ZK5VRH73AKHQM6Y9VNX","username":"foss_satan","acct":"foss_satan@fossbros-anonymous.io","display_name":"big gerald","locked":false,"discoverable":true,"bot":false,"created_at":"2021-09-26T10:52:36.000Z","note":"i post about like, i dunno, stuff, or whatever!!!!","url":"http://fossbros-anonymous.io/@foss_satan","avatar":"","avatar_static":"","header":"http://localhost:8080/assets/default_header.webp","header_static":"http://localhost:8080/assets/default_header.webp","followers_count":0,"following_count":0,"statuses_count":3,"last_status_at":"2021-09-11T09:40:37.000Z","emojis":[],"fields":[],"mute_expires_at":null}]`)
if err != nil {
suite.FailNow(err.Error())
}
diff --git a/internal/api/client/reports/reportget_test.go b/internal/api/client/reports/reportget_test.go
index 4f01101b2..6b0cf89e0 100644
--- a/internal/api/client/reports/reportget_test.go
+++ b/internal/api/client/reports/reportget_test.go
@@ -125,8 +125,8 @@ func (suite *ReportGetTestSuite) TestGetReport1() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
diff --git a/internal/api/client/reports/reportsget_test.go b/internal/api/client/reports/reportsget_test.go
index 2413292a0..96fcafc22 100644
--- a/internal/api/client/reports/reportsget_test.go
+++ b/internal/api/client/reports/reportsget_test.go
@@ -151,8 +151,8 @@ func (suite *ReportsGetTestSuite) TestGetReports() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -241,8 +241,8 @@ func (suite *ReportsGetTestSuite) TestGetReports4() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -315,8 +315,8 @@ func (suite *ReportsGetTestSuite) TestGetReports6() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -373,8 +373,8 @@ func (suite *ReportsGetTestSuite) TestGetReports7() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
diff --git a/internal/processing/stream/notification_test.go b/internal/processing/stream/notification_test.go
index e12f23abe..2e83714fa 100644
--- a/internal/processing/stream/notification_test.go
+++ b/internal/processing/stream/notification_test.go
@@ -74,8 +74,8 @@ func (suite *NotificationTestSuite) TestStreamNotification() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
diff --git a/internal/processing/stream/statusupdate_test.go b/internal/processing/stream/statusupdate_test.go
index da32be48b..2ae3f217b 100644
--- a/internal/processing/stream/statusupdate_test.go
+++ b/internal/processing/stream/statusupdate_test.go
@@ -85,8 +85,8 @@ func (suite *StatusUpdateTestSuite) TestStreamNotification() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
diff --git a/internal/typeutils/defaulticons.go b/internal/typeutils/defaulticons.go
index e3a090109..88785879c 100644
--- a/internal/typeutils/defaulticons.go
+++ b/internal/typeutils/defaulticons.go
@@ -28,7 +28,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/log"
)
-const defaultHeaderPath = "/assets/default_header.png"
+const defaultHeaderPath = "/assets/default_header.webp"
// populateDefaultAvatars returns a slice of standard avatars found
// in the path [web-assets-base-dir]/default_avatars. The slice
@@ -73,7 +73,7 @@ func populateDefaultAvatars() (defaultAvatars []string) {
// take only files with simple extensions
// that we know will work OK as avatars
switch strings.ToLower(extension) {
- case "jpeg", "jpg", "gif", "png":
+ case "jpeg", "jpg", "gif", "png", "webp":
avatarURL := config.GetProtocol() + "://" + config.GetHost() + "/assets/default_avatars/" + fileName
defaultAvatars = append(defaultAvatars, avatarURL)
default:
diff --git a/internal/typeutils/internaltofrontend.go b/internal/typeutils/internaltofrontend.go
index f11c4af21..f64f4acff 100644
--- a/internal/typeutils/internaltofrontend.go
+++ b/internal/typeutils/internaltofrontend.go
@@ -1466,7 +1466,7 @@ func (c *Converter) InstanceToAPIV1Instance(ctx context.Context, i *gtsmodel.Ins
instance.ThumbnailType = iAccount.AvatarMediaAttachment.File.ContentType
instance.ThumbnailDescription = iAccount.AvatarMediaAttachment.Description
} else {
- instance.Thumbnail = config.GetProtocol() + "://" + i.Domain + "/assets/logo.png" // default thumb
+ instance.Thumbnail = config.GetProtocol() + "://" + i.Domain + "/assets/logo.webp" // default thumb
}
// contact account
@@ -1536,7 +1536,7 @@ func (c *Converter) InstanceToAPIV2Instance(ctx context.Context, i *gtsmodel.Ins
thumbnail.Description = iAccount.AvatarMediaAttachment.Description
thumbnail.Blurhash = iAccount.AvatarMediaAttachment.Blurhash
} else {
- thumbnail.URL = config.GetProtocol() + "://" + i.Domain + "/assets/logo.png" // default thumb
+ thumbnail.URL = config.GetProtocol() + "://" + i.Domain + "/assets/logo.webp" // default thumb
}
instance.Thumbnail = thumbnail
diff --git a/internal/typeutils/internaltofrontend_test.go b/internal/typeutils/internaltofrontend_test.go
index f335e6fce..aeb7ea0b9 100644
--- a/internal/typeutils/internaltofrontend_test.go
+++ b/internal/typeutils/internaltofrontend_test.go
@@ -149,8 +149,8 @@ func (suite *InternalToFrontendTestSuite) TestAccountToFrontendAliasedAndMoved()
"url": "http://localhost:8080/@1happyturtle",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 8,
@@ -350,8 +350,8 @@ func (suite *InternalToFrontendTestSuite) TestAccountToFrontendPublicPunycode()
"url": "https://xn--xample-ova.org/users/@%C3%BCser",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 0,
@@ -388,8 +388,8 @@ func (suite *InternalToFrontendTestSuite) TestLocalInstanceAccountToFrontendPubl
"url": "http://localhost:8080/@localhost:8080",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 0,
@@ -426,8 +426,8 @@ func (suite *InternalToFrontendTestSuite) TestLocalInstanceAccountToFrontendBloc
"url": "http://localhost:8080/@localhost:8080",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 0,
@@ -484,8 +484,8 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontend() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -633,8 +633,8 @@ func (suite *InternalToFrontendTestSuite) TestWarnFilteredStatusToFrontend() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -866,8 +866,8 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendUnknownAttachments
"url": "http://example.org/@Some_User",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 1,
@@ -994,8 +994,8 @@ func (suite *InternalToFrontendTestSuite) TestStatusToWebStatus() {
"url": "http://example.org/@Some_User",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 1,
@@ -1155,8 +1155,8 @@ func (suite *InternalToFrontendTestSuite) TestStatusToFrontendUnknownLanguage()
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -1471,7 +1471,7 @@ func (suite *InternalToFrontendTestSuite) TestInstanceV1ToFrontend() {
"status_count": 20,
"user_count": 4
},
- "thumbnail": "http://localhost:8080/assets/logo.png",
+ "thumbnail": "http://localhost:8080/assets/logo.webp",
"contact_account": {
"id": "01F8MH17FWEB39HZJ76B6VXSKF",
"username": "admin",
@@ -1485,8 +1485,8 @@ func (suite *InternalToFrontendTestSuite) TestInstanceV1ToFrontend() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -1535,7 +1535,7 @@ func (suite *InternalToFrontendTestSuite) TestInstanceV2ToFrontend() {
}
},
"thumbnail": {
- "url": "http://localhost:8080/assets/logo.png"
+ "url": "http://localhost:8080/assets/logo.webp"
},
"languages": [
"nl",
@@ -1619,8 +1619,8 @@ func (suite *InternalToFrontendTestSuite) TestInstanceV2ToFrontend() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -1735,8 +1735,8 @@ func (suite *InternalToFrontendTestSuite) TestReportToFrontend1() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -1778,8 +1778,8 @@ func (suite *InternalToFrontendTestSuite) TestReportToFrontend2() {
"url": "http://localhost:8080/@1happyturtle",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 8,
@@ -1853,8 +1853,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend1() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -1894,8 +1894,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend1() {
"url": "http://localhost:8080/@1happyturtle",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 8,
@@ -1951,8 +1951,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend1() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -1997,8 +1997,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend1() {
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -2066,8 +2066,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend2() {
"url": "http://localhost:8080/@1happyturtle",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 8,
@@ -2123,8 +2123,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend2() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -2170,8 +2170,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontend2() {
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -2321,8 +2321,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontendSuspendedLoca
"url": "http://fossbros-anonymous.io/@foss_satan",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 3,
@@ -2362,8 +2362,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontendSuspendedLoca
"url": "http://localhost:8080/@1happyturtle",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 0,
"following_count": 0,
"statuses_count": 0,
@@ -2408,8 +2408,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontendSuspendedLoca
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,
@@ -2454,8 +2454,8 @@ func (suite *InternalToFrontendTestSuite) TestAdminReportToFrontendSuspendedLoca
"url": "http://localhost:8080/@admin",
"avatar": "",
"avatar_static": "",
- "header": "http://localhost:8080/assets/default_header.png",
- "header_static": "http://localhost:8080/assets/default_header.png",
+ "header": "http://localhost:8080/assets/default_header.webp",
+ "header_static": "http://localhost:8080/assets/default_header.webp",
"followers_count": 1,
"following_count": 1,
"statuses_count": 4,