mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] use a much shorter refresh limit for statuses with polls (#2453)
* specifically use a much shorter refresh limit for statuses with polls * allow specifying whether status must be upToDate in calls to Get(Visible)?TargetStatusBy_(), limit force refresh to 5 minute cooldown * remove the PollID check from statusUpToDate() * remove unnecessary force flag checks * remove unused field * check refresh status error * use argument name 'refresh' instead of 'upToDate' to better fit with the codebase * add statuses_poll_id_idx * remove the definitely-not copy-pasted comment i accidentally typed out in full * only synchronously refresh if the refresh flag is provided, otherwise do async * fix wrong force value being provided for async --------- Co-authored-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
@@ -39,7 +39,11 @@ const allowedPinnedCount = 10
|
||||
// - Status is public, unlisted, or followers-only.
|
||||
// - Status is not a boost.
|
||||
func (p *Processor) getPinnableStatus(ctx context.Context, requestingAccount *gtsmodel.Account, targetStatusID string) (*gtsmodel.Status, gtserror.WithCode) {
|
||||
targetStatus, errWithCode := p.c.GetVisibleTargetStatus(ctx, requestingAccount, targetStatusID)
|
||||
targetStatus, errWithCode := p.c.GetVisibleTargetStatus(ctx,
|
||||
requestingAccount,
|
||||
targetStatusID,
|
||||
false, // refresh
|
||||
)
|
||||
if errWithCode != nil {
|
||||
return nil, errWithCode
|
||||
}
|
||||
|
Reference in New Issue
Block a user