diff options
author | 2023-11-08 14:32:17 +0000 | |
---|---|---|
committer | 2023-11-08 14:32:17 +0000 | |
commit | e9e5dc5a40926e5320cb131b035c46b1e1b0bd59 (patch) | |
tree | 52edc9fa5742f28e1e5223f51cda628ec1c35a24 /internal/processing/workers/wipestatus.go | |
parent | [chore]: Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2338) (diff) | |
download | gotosocial-e9e5dc5a40926e5320cb131b035c46b1e1b0bd59.tar.xz |
[feature] add support for polls + receiving federated status edits (#2330)
Diffstat (limited to 'internal/processing/workers/wipestatus.go')
-rw-r--r-- | internal/processing/workers/wipestatus.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/processing/workers/wipestatus.go b/internal/processing/workers/wipestatus.go index ab59f14be..90a037928 100644 --- a/internal/processing/workers/wipestatus.go +++ b/internal/processing/workers/wipestatus.go @@ -85,6 +85,21 @@ func wipeStatusF(state *state.State, media *media.Processor, surface *surface) w errs.Appendf("error deleting status faves: %w", err) } + if pollID := statusToDelete.PollID; pollID != "" { + // Delete this poll by ID from the database. + if err := state.DB.DeletePollByID(ctx, pollID); err != nil { + errs.Appendf("error deleting status poll: %w", err) + } + + // Delete any poll votes pointing to this poll ID. + if err := state.DB.DeletePollVotes(ctx, pollID); err != nil { + errs.Appendf("error deleting status poll votes: %w", err) + } + + // Cancel any scheduled expiry task for poll. + _ = state.Workers.Scheduler.Cancel(pollID) + } + // delete all boosts for this status + remove them from timelines boosts, err := state.DB.GetStatusBoosts( // we MUST set a barebones context here, |