Merge remote-tracking branch 'origin/main' into HEAD

This commit is contained in:
S0yKaf 2025-01-18 13:55:15 -05:00
commit 0e137c0f2d
1759 changed files with 864109 additions and 314186 deletions

View file

@ -618,7 +618,7 @@ func NewTestAccounts() map[string]*gtsmodel.Account {
}
if diff := len(accountsSorted) - len(preserializedKeys); diff > 0 {
keyStrings := make([]string, diff)
keyStrings := make([]string, 0, diff)
for i := 0; i < diff; i++ {
priv, _ := rsa.GenerateKey(rand.Reader, 2048)
key, _ := x509.MarshalPKCS8PrivateKey(priv)
@ -722,7 +722,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/01F8MH17FWEB39HZJ76B6VXSKF/attachment/original/01F8MH6NEM8D7527KZAECTCR76.jpg",
RemoteURL: "",
CreatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
UpdatedAt: TimeMustParse("2022-06-04T13:12:00Z"),
Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
@ -765,7 +764,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01F8MH7TDVANYKWVE8VVKFPJTJ.gif",
RemoteURL: "",
CreatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
@ -812,7 +810,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01CDR64G398ADCHXK08WWTHEZ5.mp4",
RemoteURL: "",
CreatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
Type: gtsmodel.FileTypeVideo,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
@ -862,7 +859,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01F8MH8RMYQ6MSNY3JM2XT1CQ5.jpg",
RemoteURL: "",
CreatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
@ -909,7 +905,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/avatar/original/01F8MH58A357CV5K7R7TJMSH6S.jpg",
RemoteURL: "",
CreatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
@ -956,7 +951,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/header/original/01PFPMWK2FF0D9WMHEJHR07C3Q.jpg",
RemoteURL: "",
CreatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
@ -1003,7 +997,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/01F8MH1H7YV1Z7D2C8K2730QBF/attachment/original/01J2M20K6K9XQC4WSB961YJHV6.mp3",
RemoteURL: "",
CreatedAt: TimeMustParse("2024-01-10T11:24:00+02:00"),
UpdatedAt: TimeMustParse("2024-01-10T11:24:00+02:00"),
Type: gtsmodel.FileTypeAudio,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
@ -1047,13 +1040,30 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
Header: util.Ptr(false),
Cached: util.Ptr(true),
},
"local_account_2_status_9_attachment_1": {
ID: "01JDQ164HM08SGJ7ZEK9003Z4B",
StatusID: "01JDPZEZ77X1NX0TY9M10BK1HM",
URL: "http://localhost:8080/fileserver/01FHMQX3GAABWSM0S2VZEC2SWC/attachment/original/01HE88YG74PVAB81PX2XA9F3FG.mp3",
RemoteURL: "http://example.org/fileserver/01HE7Y659ZWZ02JM4AWYJZ176Q/attachment/original/01HE892Y8ZS68TQCNPX7J888P3.mp3",
CreatedAt: TimeMustParse("2024-11-01T10:01:00+02:00"),
Type: gtsmodel.FileTypeUnknown,
FileMeta: gtsmodel.FileMeta{},
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
Description: "Jolly salsa song, public domain.",
Blurhash: "",
Processing: gtsmodel.ProcessingStatusProcessed,
File: gtsmodel.File{},
Thumbnail: gtsmodel.Thumbnail{RemoteURL: ""},
Avatar: util.Ptr(false),
Header: util.Ptr(false),
Cached: util.Ptr(false),
},
"remote_account_1_status_1_attachment_1": {
ID: "01FVW7RXPQ8YJHTEXYPE7Q8ZY0",
StatusID: "01FVW7JHQFSFK166WWKR8CBA6M",
URL: "http://localhost:8080/fileserver/01F8MH5ZK5VRH73AKHQM6Y9VNX/attachment/original/01FVW7RXPQ8YJHTEXYPE7Q8ZY0.jpg",
RemoteURL: "http://fossbros-anonymous.io/attachments/original/13bbc3f8-2b5e-46ea-9531-40b4974d9912.jpg",
CreatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
@ -1099,7 +1109,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/062G5WYKY35KKD12EMSM3F8PJ8/header/original/01PFPMWK2FF0D9WMHEJHR07C3R.jpg",
RemoteURL: "http://fossbros-anonymous.io/attachments/small/a499f55b-2d1e-4acd-98d2-1ac2ba6d79b9.jpg",
CreatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
UpdatedAt: TimeMustParse("2022-06-09T13:12:00Z"),
Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
@ -1145,7 +1154,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/01FHMQX3GAABWSM0S2VZEC2SWC/attachment/original/01HE7Y3C432WRSNS10EZM86SA5.jpg",
RemoteURL: "http://example.org/fileserver/01HE7Y659ZWZ02JM4AWYJZ176Q/attachment/original/01HE7Y6G0EMCKST3Q0914WW0MS.jpg",
CreatedAt: TimeMustParse("2023-11-02T12:44:25+02:00"),
UpdatedAt: TimeMustParse("2023-11-02T12:44:25+02:00"),
Type: gtsmodel.FileTypeImage,
FileMeta: gtsmodel.FileMeta{
Original: gtsmodel.Original{
@ -1190,7 +1198,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/01FHMQX3GAABWSM0S2VZEC2SWC/attachment/original/01HE7ZFX9GKA5ZZVD4FACABSS9.svg",
RemoteURL: "http://example.org/fileserver/01HE7Y659ZWZ02JM4AWYJZ176Q/attachment/original/01HE7ZGJYTSYMXF927GF9353KR.svg",
CreatedAt: TimeMustParse("2023-11-02T12:44:25+02:00"),
UpdatedAt: TimeMustParse("2023-11-02T12:44:25+02:00"),
Type: gtsmodel.FileTypeUnknown,
FileMeta: gtsmodel.FileMeta{},
AccountID: "01FHMQX3GAABWSM0S2VZEC2SWC",
@ -1209,7 +1216,6 @@ func NewTestAttachments() map[string]*gtsmodel.MediaAttachment {
URL: "http://localhost:8080/fileserver/01FHMQX3GAABWSM0S2VZEC2SWC/attachment/original/01HE88YG74PVAB81PX2XA9F3FG.mp3",
RemoteURL: "http://example.org/fileserver/01HE7Y659ZWZ02JM4AWYJZ176Q/attachment/original/01HE892Y8ZS68TQCNPX7J888P3.mp3",
CreatedAt: TimeMustParse("2023-11-02T12:44:25+02:00"),
UpdatedAt: TimeMustParse("2023-11-02T12:44:25+02:00"),
Type: gtsmodel.FileTypeUnknown,
FileMeta: gtsmodel.FileMeta{},
AccountID: "01FHMQX3GAABWSM0S2VZEC2SWC",
@ -1430,7 +1436,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
MentionIDs: []string{},
EmojiIDs: []string{"01F8MH9H8E4VG3KDYJR9EGPXCQ"},
CreatedAt: TimeMustParse("2021-10-20T11:36:45Z"),
UpdatedAt: TimeMustParse("2021-10-20T11:36:45Z"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/admin",
AccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
@ -1454,7 +1460,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "🐕🐕🐕🐕🐕",
Text: "🐕🐕🐕🐕🐕",
CreatedAt: TimeMustParse("2021-10-20T12:36:45Z"),
UpdatedAt: TimeMustParse("2021-10-20T12:36:45Z"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/admin",
AccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
@ -1477,7 +1483,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "hi @the_mighty_zork welcome to the instance!",
Text: "hi @the_mighty_zork welcome to the instance!",
CreatedAt: TimeMustParse("2021-11-20T13:32:16Z"),
UpdatedAt: TimeMustParse("2021-11-20T13:32:16Z"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/admin",
MentionIDs: []string{"01FF26A6BGEKCZFWNEHXB2ZZ6M"},
@ -1500,7 +1506,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
URI: "http://localhost:8080/users/admin/statuses/01G36SF3V6Y6V5BF9P4R7PQG7G",
URL: "http://localhost:8080/@admin/statuses/01G36SF3V6Y6V5BF9P4R7PQG7G",
CreatedAt: TimeMustParse("2021-10-20T12:41:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:41:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/admin",
AccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
@ -1524,7 +1530,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: `<p>Hi <span class="h-card"><a href="http://localhost:8080/@1happyturtle" class="u-url mention" rel="nofollow noreferrer noopener" target="_blank">@<span>1happyturtle</span></a></span>, can I reply?</p>`,
Text: "Hi @1happyturtle, can I reply?",
CreatedAt: TimeMustParse("2024-02-20T12:41:37+02:00"),
UpdatedAt: TimeMustParse("2024-02-20T12:41:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/admin",
MentionIDs: []string{"01J5QVP69ANF1K4WHES6GA4WXP"},
@ -1535,7 +1541,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
BoostOfID: "",
BoostOfAccountID: "",
ThreadID: "01HCWE4P0EW9HBA5WHW97D5YV0",
Visibility: gtsmodel.VisibilityUnlocked,
Visibility: gtsmodel.VisibilityPublic,
Sensitive: util.Ptr(false),
CreatedWithApplicationID: "01F8MGXQRHYF5QPMTMXP78QC2F",
Federated: util.Ptr(true),
@ -1549,7 +1555,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "hello everyone!",
Text: "hello everyone!",
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1572,7 +1578,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "this is a Public local-only post that shouldn't federate, but it's still boostable, replyable, and likeable",
Text: "this is a Public local-only post that shouldn't federate, but it's still boostable, replyable, and likeable",
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1595,7 +1601,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
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",
Text: "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: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1630,7 +1636,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Text: "here's a little gif of trent.... and also a cow",
AttachmentIDs: []string{"01F8MH7TDVANYKWVE8VVKFPJTJ", "01CDR64G398ADCHXK08WWTHEZ5"},
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1654,7 +1660,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Text: "hi!",
AttachmentIDs: []string{},
CreatedAt: TimeMustParse("2022-05-20T11:37:55Z"),
UpdatedAt: TimeMustParse("2022-05-20T11:37:55Z"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1678,7 +1684,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Text: "what do you think of sloths?",
AttachmentIDs: nil,
CreatedAt: TimeMustParse("2022-05-20T11:41:10Z"),
UpdatedAt: TimeMustParse("2022-05-20T11:41:10Z"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1702,7 +1708,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "<p>Here's a bunch of HTML, read it and weep, weep then!</p><pre><code class=\"language-html\">&lt;section class=&#34;about-user&#34;&gt;\n &lt;div class=&#34;col-header&#34;&gt;\n &lt;h2&gt;About&lt;/h2&gt;\n &lt;/div&gt; \n &lt;div class=&#34;fields&#34;&gt;\n &lt;h3 class=&#34;sr-only&#34;&gt;Fields&lt;/h3&gt;\n &lt;dl&gt;\n &lt;div class=&#34;field&#34;&gt;\n &lt;dt&gt;should you follow me?&lt;/dt&gt;\n &lt;dd&gt;maybe!&lt;/dd&gt;\n &lt;/div&gt;\n &lt;div class=&#34;field&#34;&gt;\n &lt;dt&gt;age&lt;/dt&gt;\n &lt;dd&gt;120&lt;/dd&gt;\n &lt;/div&gt;\n &lt;/dl&gt;\n &lt;/div&gt;\n &lt;div class=&#34;bio&#34;&gt;\n &lt;h3 class=&#34;sr-only&#34;&gt;Bio&lt;/h3&gt;\n &lt;p&gt;i post about things that concern me&lt;/p&gt;\n &lt;/div&gt;\n &lt;div class=&#34;sr-only&#34; role=&#34;group&#34;&gt;\n &lt;h3 class=&#34;sr-only&#34;&gt;Stats&lt;/h3&gt;\n &lt;span&gt;Joined in Jun, 2022.&lt;/span&gt;\n &lt;span&gt;8 posts.&lt;/span&gt;\n &lt;span&gt;Followed by 1.&lt;/span&gt;\n &lt;span&gt;Following 1.&lt;/span&gt;\n &lt;/div&gt;\n &lt;div class=&#34;accountstats&#34; aria-hidden=&#34;true&#34;&gt;\n &lt;b&gt;Joined&lt;/b&gt;&lt;time datetime=&#34;2022-06-04T13:12:00.000Z&#34;&gt;Jun, 2022&lt;/time&gt;\n &lt;b&gt;Posts&lt;/b&gt;&lt;span&gt;8&lt;/span&gt;\n &lt;b&gt;Followed by&lt;/b&gt;&lt;span&gt;1&lt;/span&gt;\n &lt;b&gt;Following&lt;/b&gt;&lt;span&gt;1&lt;/span&gt;\n &lt;/div&gt;\n&lt;/section&gt;\n</code></pre><p>There, hope you liked that!</p>",
Text: "Here's a bunch of HTML, read it and weep, weep then!\n\n```html\n<section class=\"about-user\">\n <div class=\"col-header\">\n <h2>About</h2>\n </div> \n <div class=\"fields\">\n <h3 class=\"sr-only\">Fields</h3>\n <dl>\n <div class=\"field\">\n <dt>should you follow me?</dt>\n <dd>maybe!</dd>\n </div>\n <div class=\"field\">\n <dt>age</dt>\n <dd>120</dd>\n </div>… <h3 class=\"sr-only\">Stats</h3>\n <span>Joined in Jun, 2022.</span>\n <span>8 posts.</span>\n <span>Followed by 1.</span>\n <span>Following 1.</span>\n </div>\n <div class=\"accountstats\" aria-hidden=\"true\">\n <b>Joined</b><time datetime=\"2022-06-04T13:12:00.000Z\">Jun, 2022</time>\n <b>Posts</b><span>8</span>\n <b>Followed by</b><span>1</span>\n <b>Following</b><span>1</span>\n </div>\n</section>\n```\n\nThere, hope you liked that!",
CreatedAt: TimeMustParse("2023-12-10T11:24:00+02:00"),
UpdatedAt: TimeMustParse("2023-12-10T11:24:00+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1726,7 +1732,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Text: "Thanks! Here's a NIN track",
AttachmentIDs: []string{"01J2M20K6K9XQC4WSB961YJHV6"},
CreatedAt: TimeMustParse("2024-01-10T11:24:00+02:00"),
UpdatedAt: TimeMustParse("2024-01-10T11:24:00+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -1743,6 +1749,32 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Federated: util.Ptr(true),
ActivityStreamsType: ap.ObjectNote,
},
"local_account_1_status_9": {
ID: "01JDPZC707CKDN8N4QVWM4Z1NR",
URI: "http://localhost:8080/users/the_mighty_zork/statuses/01JDPZC707CKDN8N4QVWM4Z1NR",
URL: "http://localhost:8080/@the_mighty_zork/statuses/01JDPZC707CKDN8N4QVWM4Z1NR",
Content: "<p>this is the latest revision of the status, with a content-warning</p>",
Text: "this is the latest revision of the status, with a content-warning",
ContentWarning: "edited status",
AttachmentIDs: nil,
CreatedAt: TimeMustParse("2024-11-01T11:00:00+02:00"),
EditedAt: TimeMustParse("2024-11-01T11:02:00+02:00"),
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
InReplyToID: "",
InReplyToAccountID: "",
InReplyToURI: "",
BoostOfID: "",
ThreadID: "",
EditIDs: []string{"01JDPZCZ2Y9KSGZW0R7ZG8T8Y2", "01JDPZDADMD1T9HKF94RECF7PP"},
Visibility: gtsmodel.VisibilityPublic,
Sensitive: util.Ptr(false),
Language: "en",
CreatedWithApplicationID: "01F8MGY43H3N2C8EWPR2FPYEXG",
Federated: util.Ptr(true),
ActivityStreamsType: ap.ObjectNote,
},
"local_account_2_status_1": {
ID: "01F8MHBQCBTDKN6X5VHGMMN4MA",
URI: "http://localhost:8080/users/1happyturtle/statuses/01F8MHBQCBTDKN6X5VHGMMN4MA",
@ -1750,7 +1782,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "🐢 hi everyone i post about turtles 🐢",
Text: "🐢 hi everyone i post about turtles 🐢",
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1773,7 +1805,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "🐢 this one is federated, likeable, and boostable but not replyable 🐢",
Text: "🐢 this one is federated, likeable, and boostable but not replyable 🐢",
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1807,7 +1839,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "🐢 i don't mind people sharing and liking this one but I want to moderate replies to it 🐢",
Text: "🐢 i don't mind people sharing and liking this one but I want to moderate replies to it 🐢",
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1815,7 +1847,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
BoostOfID: "",
ThreadID: "01HCWE4P0EW9HBA5WHW97D5YV0",
ContentWarning: "you won't be able to reply to this without my approval",
Visibility: gtsmodel.VisibilityUnlocked,
Visibility: gtsmodel.VisibilityPublic,
Sensitive: util.Ptr(true),
Language: "en",
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
@ -1842,7 +1874,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "🐢 this is a public status but I want it local only and not boostable 🐢",
Text: "🐢 this is a public status but I want it local only and not boostable 🐢",
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1876,7 +1908,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "🐢 @the_mighty_zork hi zork! 🐢",
Text: "🐢 @the_mighty_zork hi zork! 🐢",
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/1happyturtle",
MentionIDs: []string{"01FDF2HM2NF6FSRZCDEDV451CN"},
@ -1902,7 +1934,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "🐢 @the_mighty_zork hi zork, this is a direct message, shhhhhh! 🐢",
Text: "🐢 @the_mighty_zork hi zork, this is a direct message, shhhhhh! 🐢",
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/1happyturtle",
MentionIDs: []string{"01FDF2HM2NF6FSRZCDEDV451CN"},
@ -1930,7 +1962,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Text: "🐢 hi followers! did u know i'm a turtle? 🐢",
AttachmentIDs: []string{},
CreatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-10-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1954,7 +1986,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Text: "hey everyone i got stuck in a shed. any ideas for how to get out?",
AttachmentIDs: nil,
CreatedAt: TimeMustParse("2021-07-28T10:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-07-28T10:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/1happyturtle",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -1971,6 +2003,32 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
PollID: "01HEN2QB5NR4NCEHGYC3HN84K6",
PendingApproval: util.Ptr(false),
},
"local_account_2_status_9": {
ID: "01JDPZEZ77X1NX0TY9M10BK1HM",
URI: "http://localhost:8080/users/1happyturtle/statuses/01JDPZEZ77X1NX0TY9M10BK1HM",
URL: "http://localhost:8080/@1happyturtle/statuses/01JDPZEZ77X1NX0TY9M10BK1HM",
Content: "<p>now edited to bring back the previous edit's media!</p>",
Text: "now edited to bring back the previous edit's media!",
ContentWarning: "edit with media attachments",
AttachmentIDs: []string{"01JDQ164HM08SGJ7ZEK9003Z4B"},
CreatedAt: TimeMustParse("2024-11-01T10:00:00+02:00"),
EditedAt: TimeMustParse("2024-11-01T10:03:00+02:00"),
Local: util.Ptr(true),
AccountURI: "http://localhost:8080/users/the_mighty_zork",
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
InReplyToID: "",
InReplyToAccountID: "",
InReplyToURI: "",
BoostOfID: "",
ThreadID: "",
EditIDs: []string{"01JDPZPBXAX0M02YSEPB21KX4R", "01JDPZPJHKP7E3M0YQXEXPS1YT", "01JDPZPY3F85Y7B78ETRXEMWD9"},
Visibility: gtsmodel.VisibilityPublic,
Sensitive: util.Ptr(false),
Language: "en",
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
Federated: util.Ptr(true),
ActivityStreamsType: ap.ObjectNote,
},
"remote_account_1_status_1": {
ID: "01FVW7JHQFSFK166WWKR8CBA6M",
URI: "http://fossbros-anonymous.io/users/foss_satan/statuses/01FVW7JHQFSFK166WWKR8CBA6M",
@ -1978,7 +2036,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "dark souls status bot: \"thoughts of dog\"",
AttachmentIDs: []string{"01FVW7RXPQ8YJHTEXYPE7Q8ZY0"},
CreatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-09-20T12:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(false),
AccountURI: "http://fossbros-anonymous.io/users/foss_satan",
MentionIDs: []string{},
@ -2003,7 +2061,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "what products should i buy at the grocery store?",
AttachmentIDs: []string{"01FVW7RXPQ8YJHTEXYPE7Q8ZY0"},
CreatedAt: TimeMustParse("2021-09-11T11:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-09-11T11:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(false),
AccountURI: "http://fossbros-anonymous.io/users/foss_satan",
AccountID: "01F8MH5ZK5VRH73AKHQM6Y9VNX",
@ -2028,7 +2086,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: "what products should i buy at the grocery store? (now an endless poll!)",
AttachmentIDs: []string{"01FVW7RXPQ8YJHTEXYPE7Q8ZY0"},
CreatedAt: TimeMustParse("2021-09-11T11:40:37+02:00"),
UpdatedAt: TimeMustParse("2021-09-11T11:40:37+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(false),
AccountURI: "http://fossbros-anonymous.io/users/foss_satan",
AccountID: "01F8MH5ZK5VRH73AKHQM6Y9VNX",
@ -2046,6 +2104,33 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
PollID: "01HEWV1GW2D49R919NPEDXPTZ5",
PendingApproval: util.Ptr(false),
},
"remote_account_1_status_4": {
ID: "01JDQ07JZTX9CMDJP67CNA71YD",
URI: "http://fossbros-anonymous.io/users/foss_satan/statuses/______",
URL: "http://fossbros-anonymous.io/@foss_satan/statuses/______",
Content: "<p>this is the latest status edit without poll change</p>",
Text: "this is the latest status edit without poll change",
ContentWarning: "",
AttachmentIDs: nil,
CreatedAt: TimeMustParse("2024-11-01T09:00:00+02:00"),
EditedAt: TimeMustParse("2024-11-01T09:02:00+02:00"),
Local: util.Ptr(false),
AccountURI: "http://fossbros-anonymous.io/users/foss_satan",
AccountID: "01F8MH5ZK5VRH73AKHQM6Y9VNX",
InReplyToID: "",
InReplyToAccountID: "",
InReplyToURI: "",
BoostOfID: "",
ThreadID: "",
EditIDs: []string{"01JDQ07ZZ4FGP13YN8TF63P5A6", "01JDQ08AYQC0G6413VAHA51CV9"},
PollID: "01JDQ0EZ5HM9T4WXRQ5WSVD40J",
Visibility: gtsmodel.VisibilityPublic,
Sensitive: util.Ptr(false),
Language: "en",
CreatedWithApplicationID: "01F8MGYG9E893WRHW0TAEXR8GJ",
Federated: util.Ptr(true),
ActivityStreamsType: ap.ObjectNote,
},
"remote_account_2_status_1": {
ID: "01HE7XJ1CG84TBKH5V9XKBVGF5",
URI: "http://example.org/users/Some_User/statuses/01HE7XJ1CG84TBKH5V9XKBVGF5",
@ -2053,7 +2138,7 @@ func NewTestStatuses() map[string]*gtsmodel.Status {
Content: `<p>hi <span class="h-card"><a href="http://localhost:8080/@admin" class="u-url mention" rel="nofollow noreferrer noopener" target="_blank">@<span>admin</span></a></span> here's some media for ya</p>`,
AttachmentIDs: []string{"01HE7Y3C432WRSNS10EZM86SA5", "01HE7ZFX9GKA5ZZVD4FACABSS9", "01HE88YG74PVAB81PX2XA9F3FG"},
CreatedAt: TimeMustParse("2023-11-02T12:44:25+02:00"),
UpdatedAt: TimeMustParse("2023-11-02T12:44:25+02:00"),
EditedAt: time.Time{},
Local: util.Ptr(false),
AccountURI: "http://example.org/users/Some_User",
MentionIDs: []string{"01HE7XQNMKTVC8MNPCE1JGK4J3"},
@ -2129,6 +2214,19 @@ func NewTestPolls() map[string]*gtsmodel.Poll {
ClosedAt: time.Time{},
Closing: false,
},
"remote_account_1_status_4_poll": {
ID: "01JDQ0EZ5HM9T4WXRQ5WSVD40J",
Multiple: util.Ptr(false),
HideCounts: util.Ptr(false),
Options: []string{"yes", "no", "maybe", "i don't know", "can you repeat the question"},
Votes: []int{0, 0, 0, 0, 2},
Voters: util.Ptr(2),
StatusID: "01JDQ07JZTX9CMDJP67CNA71YD",
// empty expiry AND closed date, i.e. no end
ExpiresAt: time.Time{},
ClosedAt: time.Time{},
Closing: false,
},
}
}
@ -2188,6 +2286,24 @@ func NewTestPollVotes() map[string]*gtsmodel.PollVote {
Poll: nil,
CreatedAt: TimeMustParse("2021-09-11T11:47:37+02:00"),
},
"remote_account_1_status_4_poll_vote_local_account_1": {
ID: "01JDQ0SX9QVVFHS7P8M1PA3SVG",
Choices: []int{4},
AccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
Account: nil,
PollID: "01JDQ0EZ5HM9T4WXRQ5WSVD40J",
Poll: nil,
CreatedAt: TimeMustParse("2024-11-01T09:01:30+02:00"),
},
"remote_account_1_status_4_poll_vote_local_account_2": {
ID: "01JDQ0T3EEDN7SAVBQMQP4PR12",
Choices: []int{4},
AccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
Account: nil,
PollID: "01JDQ0EZ5HM9T4WXRQ5WSVD40J",
Poll: nil,
CreatedAt: TimeMustParse("2024-11-01T09:02:30+02:00"),
},
}
}
@ -2345,7 +2461,6 @@ func NewTestMentions() map[string]*gtsmodel.Mention {
ID: "01FCTA2Y6FGHXQA4ZE6N5NMNEX",
StatusID: "01FCTA44PW9H1TB328S9AQXKDS",
CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
OriginAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
OriginAccountURI: "http://localhost:8080/users/the_mighty_zork",
TargetAccountID: "01F8MH5ZK5VRH73AKHQM6Y9VNX",
@ -2357,7 +2472,6 @@ func NewTestMentions() map[string]*gtsmodel.Mention {
ID: "01FDF2HM2NF6FSRZCDEDV451CN",
StatusID: "01FCQSQ667XHJ9AV9T27SJJSX5",
CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
OriginAccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
OriginAccountURI: "http://localhost:8080/users/1happyturtle",
TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -2369,7 +2483,6 @@ func NewTestMentions() map[string]*gtsmodel.Mention {
ID: "01FN3VKDEF4CN2W9TKX339BEHB",
StatusID: "01FN3VJGFH10KR7S2PB0GFJZYG",
CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
OriginAccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
OriginAccountURI: "http://localhost:8080/users/1happyturtle",
TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -2381,7 +2494,6 @@ func NewTestMentions() map[string]*gtsmodel.Mention {
ID: "01FF26A6BGEKCZFWNEHXB2ZZ6M",
StatusID: "01FF25D5Q0DH7CHD57CTRS6WK0",
CreatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
UpdatedAt: TimeMustParse("2022-05-14T13:21:09+02:00"),
OriginAccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
OriginAccountURI: "http://localhost:8080/users/admin",
TargetAccountID: "01F8MH1H7YV1Z7D2C8K2730QBF",
@ -2393,7 +2505,6 @@ func NewTestMentions() map[string]*gtsmodel.Mention {
ID: "01J5QVP69ANF1K4WHES6GA4WXP",
StatusID: "01J5QVB9VC76NPPRQ207GG4DRZ",
CreatedAt: TimeMustParse("2024-02-20T12:41:37+02:00"),
UpdatedAt: TimeMustParse("2024-02-20T12:41:37+02:00"),
OriginAccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
OriginAccountURI: "http://localhost:8080/users/admin",
TargetAccountID: "01F8MH5NBDF2MV7CTC4Q5128HF",
@ -2405,7 +2516,6 @@ func NewTestMentions() map[string]*gtsmodel.Mention {
ID: "01HE7XQNMKTVC8MNPCE1JGK4J3",
StatusID: "01HE7XJ1CG84TBKH5V9XKBVGF5",
CreatedAt: TimeMustParse("2023-11-02T12:44:25+02:00"),
UpdatedAt: TimeMustParse("2023-11-02T12:44:25+02:00"),
OriginAccountID: "01FHMQX3GAABWSM0S2VZEC2SWC",
OriginAccountURI: "http://example.org/users/Some_User",
TargetAccountID: "01F8MH17FWEB39HZJ76B6VXSKF",
@ -3494,6 +3604,102 @@ func NewTestInteractionRequests() map[string]*gtsmodel.InteractionRequest {
}
}
func NewTestStatusEdits() map[string]*gtsmodel.StatusEdit {
return map[string]*gtsmodel.StatusEdit{
"local_account_1_status_9_edit_1": {
ID: "01JDPZCZ2Y9KSGZW0R7ZG8T8Y2",
Content: "<p>this is the original status</p>",
ContentWarning: "",
Text: "this is the original status",
Language: "en",
Sensitive: util.Ptr(false),
AttachmentIDs: nil,
PollOptions: nil,
PollVotes: nil,
StatusID: "01JDPZC707CKDN8N4QVWM4Z1NR",
CreatedAt: TimeMustParse("2024-11-01T11:00:00+02:00"),
},
"local_account_1_status_9_edit_2": {
ID: "01JDPZDADMD1T9HKF94RECF7PP",
Content: "<p>this is the first status edit! now with content-warning</p>",
ContentWarning: "edited status",
Text: "this is the first status edit! now with content-warning",
Language: "en",
Sensitive: util.Ptr(false),
AttachmentIDs: nil,
PollOptions: nil,
PollVotes: nil,
StatusID: "01JDPZC707CKDN8N4QVWM4Z1NR",
CreatedAt: TimeMustParse("2024-11-01T11:01:00+02:00"),
},
"local_account_2_status_9_edit_1": {
ID: "01JDPZPBXAX0M02YSEPB21KX4R",
Content: "<p>this is the original status</p>",
ContentWarning: "",
Text: "this is the original status",
Language: "en",
Sensitive: util.Ptr(false),
AttachmentIDs: nil,
PollOptions: nil,
PollVotes: nil,
StatusID: "01JDPZEZ77X1NX0TY9M10BK1HM",
CreatedAt: TimeMustParse("2024-11-01T10:00:00+02:00"),
},
"local_account_2_status_9_edit_2": {
ID: "01JDPZPJHKP7E3M0YQXEXPS1YT",
Content: "<p>now edited to have some media!</p>",
ContentWarning: "edit with media attachments",
Text: "now edited to have some media!",
Language: "en",
Sensitive: util.Ptr(true),
AttachmentIDs: []string{"01JDQ164HM08SGJ7ZEK9003Z4B"},
PollOptions: nil,
PollVotes: nil,
StatusID: "01JDPZEZ77X1NX0TY9M10BK1HM",
CreatedAt: TimeMustParse("2024-11-01T10:01:00+02:00"),
},
"local_account_2_status_9_edit_3": {
ID: "01JDPZPY3F85Y7B78ETRXEMWD9",
Content: "<p>now edited to remove the media</p>",
ContentWarning: "edit missing previous media attachments",
Text: "now edited to remove the media",
Language: "en",
Sensitive: util.Ptr(false),
AttachmentIDs: nil,
PollOptions: nil,
PollVotes: nil,
StatusID: "01JDPZEZ77X1NX0TY9M10BK1HM",
CreatedAt: TimeMustParse("2024-11-01T10:02:00+02:00"),
},
"remote_account_1_status_4_edit_1": {
ID: "01JDQ07ZZ4FGP13YN8TF63P5A6",
Content: "<p>this is the original status, with a poll!</p>",
ContentWarning: "",
Text: "this is the original status, with a poll!",
Language: "en",
Sensitive: util.Ptr(false),
AttachmentIDs: nil,
PollOptions: []string{"yes", "no", "spiderman"},
PollVotes: []int{42, 42, 69},
StatusID: "01JDQ07JZTX9CMDJP67CNA71YD",
CreatedAt: TimeMustParse("2024-11-01T09:00:00+02:00"),
},
"remote_account_1_status_4_edit_2": {
ID: "01JDQ08AYQC0G6413VAHA51CV9",
Content: "<p>this is the first status edit! now with a different poll!</p>",
ContentWarning: "edited status",
Text: "this is the first status edit! now with a different poll!",
Language: "en",
Sensitive: util.Ptr(false),
AttachmentIDs: nil,
PollOptions: []string{"yes", "no", "maybe", "i don't know", "can you repeat the question"},
PollVotes: []int{0, 0, 0, 0, 1},
StatusID: "01JDQ07JZTX9CMDJP67CNA71YD",
CreatedAt: TimeMustParse("2024-11-01T09:01:00+02:00"),
},
}
}
// GetSignatureForActivity prepares a mock HTTP request as if it were going to deliver activity to destination signed for privkey and pubKeyID, signs the request and returns the header values.
func GetSignatureForActivity(activity pub.Activity, pubKeyID string, privkey *rsa.PrivateKey, destination *url.URL) (signatureHeader string, digestHeader string, dateHeader string) {
// convert the activity into json bytes