diff options
author | ThibG <thib@sitedethib.com> | 2019-03-08 00:54:50 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-03-08 00:54:50 +0100 |
commit | 3aaac4f134eb092baeb0ba5979bdb3abd702a4ee (patch) | |
tree | 166112abcd990ece652d0be5792be5d54edd58cc /app/lib/activitypub/activity | |
parent | 054bbb3da21b2c76374eb921cba862adb8d5a0b3 (diff) |
Do not allow adding votes to expired polls (#10214)
* Do not allow adding votes to expired polls * Only validate expires_at on create
Diffstat (limited to 'app/lib/activitypub/activity')
-rw-r--r-- | app/lib/activitypub/activity/create.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index 87179030c..7e4e57ead 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -241,6 +241,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity def poll_vote? return false if replied_to_status.nil? || replied_to_status.poll.nil? || !replied_to_status.local? || !replied_to_status.poll.options.include?(@object['name']) + return true if replied_to_status.poll.expired? replied_to_status.poll.votes.create!(account: @account, choice: replied_to_status.poll.options.index(@object['name']), uri: @object['id']) end |