summaryrefslogtreecommitdiff
path: root/internal/processing/workers
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-03-04 12:30:12 +0000
committerLibravatar GitHub <noreply@github.com>2024-03-04 12:30:12 +0000
commitd85727e184a8398ce0ffa40dfd01207342889076 (patch)
tree5ee1860f93157bb2e4649fd86224f43eaa61dd7e /internal/processing/workers
parent[bugfix] Sanitize incoming PropertyValue fields (#2722) (diff)
downloadgotosocial-d85727e184a8398ce0ffa40dfd01207342889076.tar.xz
[bugfix] check remote status permissibility (#2703)
* add more stringent checks for remote status permissibility * add check for inreplyto of a remote status being a boost * do not permit inReplyTo boost wrapper statuses * change comment wording * fix calls to NewFederator() * add code comments for NotPermitted() and SetNotPermitted() * improve comment * check that existing != nil before attempting delete * ensure replying account isn't suspended * use a debug log instead of info. check for boost using ID * shorten log string length. make info level * add note that replying to boost wrapper status shouldn't be able to happen anyways * update to use onFail() function
Diffstat (limited to 'internal/processing/workers')
-rw-r--r--internal/processing/workers/fromfediapi_test.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/processing/workers/fromfediapi_test.go b/internal/processing/workers/fromfediapi_test.go
index 446355628..60a9e785e 100644
--- a/internal/processing/workers/fromfediapi_test.go
+++ b/internal/processing/workers/fromfediapi_test.go
@@ -90,9 +90,17 @@ func (suite *FromFediAPITestSuite) TestProcessReplyMention() {
replyingAccount := suite.testAccounts["remote_account_1"]
// Set the replyingAccount's last fetched_at
- // date to something recent so no refresh is attempted.
+ // date to something recent so no refresh is attempted,
+ // and ensure it isn't a suspended account.
replyingAccount.FetchedAt = time.Now()
- err := suite.state.DB.UpdateAccount(context.Background(), replyingAccount, "fetched_at")
+ replyingAccount.SuspendedAt = time.Time{}
+ replyingAccount.SuspensionOrigin = ""
+ err := suite.state.DB.UpdateAccount(context.Background(),
+ replyingAccount,
+ "fetched_at",
+ "suspended_at",
+ "suspension_origin",
+ )
suite.NoError(err)
// Get replying statusable to use from remote test statuses.